Jump to content

Global variable causing mismatch errors


ElliotSternberg

Recommended Posts

I'm really annoyed. I wanted to make a bank for part of a mod I'm making, but the damn code won't compile right. =/ I keep getting the error below:

Compiling "WithdrawGoldScript"...
g:\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\WithdrawGoldScript.psc(7,4): type mismatch while assigning to a int (cast missing or types unrelated)
No output generated for WithdrawGoldScript, compilation failed.

I can't figure it out. I've searched for about 2 hours, so please offer some quick help. (It's probably a face-palm worth error if past experience is anything to go by.) Here's the code:

Scriptname WithdrawGoldScript extends activemagiceffect  
ObjectReference Property Gold001 Auto
GlobalVariable Property GoldStoredInBank  auto  

Event OnEffectStart(Actor player, Actor akCaster)

int goldvar = GoldStoredInBank.Getvalue()
if(goldvar >= 1000)
GetCasterActor().AddItem(Gold001, 1000)
goldvar - 1000

ElseIf(goldvar < 1000)
GetCasterActor().AddItem(Gold001, goldvar)
goldvar = 0
Debug.MessageBox("You're out of Septims, please deposit more soon to take advantage of our payment services!")
Else
Debug.MessageBox("You're out of Septims! Careful or you'll have some... collectors coming...")
EndIf
EndEvent

 

I've got a global variable in the CK that it refers to. This is on a magic effect, so I can make a lesser power to activate this. Let me know what to do, thanks a million.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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