Jump to content

[LE] Scripting Advice: Script to take gold from player


Recommended Posts

Srsl...

What do you pref? Golden Shovel or Deep Mine Order?

 

Topic created: 2016

Last Post: 2017

 

Create your own Topic why you mine so old topics xDDD

 

Here... when you hit Player lost 1 gold coin

 

Also... GJ Nexus, 2019 and still no Double Post Span...

You can edit you post, you have button in right bottom corner Quibblonian101

Scriptname QLG_SimpleScript_TakeGold extends MagicEffect

	Actor Property QPlayer Auto
	{ Player Ref. }

	MiscObject Property GoldRef Auto
	{ Reference to Gold ( Item ) }
	
Event OnEffectStart( Actor QTar, Actor QCas )
	If( ( QCas == QPlayer ) && ( QPlayer.GetGoldAmount() >= 1 ) )
		QPlayer.RemoveItem( GoldRef , 1 )
	Else
		Debug.Notification("Sorry, You don't have gold !...");
	EndIf
EndEvent

1. Create new script

2. Copy / Paste

3. Create new Spell

4. Attach script to spell

5. each time you use spell you lose 1 gold coin

 

remember to fill properties or script will do nothing...

Edited by TobiaszPL
Link to comment
Share on other sites

  On 7/20/2019 at 10:30 PM, TobiaszPL said:

Srsl...

What do you pref? Golden Shovel or Deep Mine Order?

 

Topic created: 2016

Last Post: 2017

 

Create your own Topic why you mine so old topics xDDD

 

Here... when you hit Player lost 1 gold coin

 

Also... GJ Nexus, 2019 and still no Double Post Span...

You can edit you post, you have button in right bottom corner Quibblonian101

Scriptname QLG_SimpleScript_TakeGold extends MagicEffect

	Actor Property QPlayer Auto
	{ Player Ref. }

	MiscObject Property GoldRef Auto
	{ Reference to Gold ( Item ) }
	
Event OnEffectStart( Actor QTar, Actor QCas )
	If( ( QCas == QPlayer ) && ( QPlayer.GetGoldAmount() >= 1 ) )
		QPlayer.RemoveItem( GoldRef , 1 )
	Else
		Debug.Notification("Sorry, You don't have gold !...");
	EndIf
EndEvent

1. Create new script

2. Copy / Paste

3. Create new Spell

4. Attach script to spell

5. each time you use spell you lose 1 gold coin

 

remember to fill properties or script will do nothing...

I'm new to using this and just found this topic through google search lol

 

I already have my spell mod and so I created the new script(Copied everything from above and successfully compiled) , added it to my spell and when going in game and casting it on an npc nothing happened.

No gold removed and not even a debug notif :\

 

So is there something I'm missing then? Or do I attach the script somewhere else?

 

I attached it to the spell effect on my spell through the creation kit.

 

EDIT: I got it to work, thanks!

Edited by Quibblonian101
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...