How do i call a function in a function??
Posted: Mon Oct 14, 2013 10:22 am
Hi all
This is what I have ATM
function onDie(self)
local x , y = getForward( ( self.facing + 2 ) % 4 )
x = x + self.x
y = y + self.y
if killcounter:getValue() == 1 then
if not isWall( self.level , x , y ) then
spawn("spider",party.level,x,y,self.facing)
end
elseif killcounter:getValue() == 2 then
sd1:open()
---- Here I want to call (function addMoney) from the (rewardslvl1) Script in the Editor (see Below) --
end
end
1 - Script Entity Name: rewardslvl1
2 - The Script function I want to call: (its from the Shop Frame work, Magnus wrote)
function addMoney()-- adds money to the party
hudPrint("Guard: Good show! Here is an added bonus for cleaning the mess up! 20 Money added.")
gui.globalVars["totalMoney"] = gui.globalVars["totalMoney"] + 20
end
Thxs for any help..
This is what I have ATM
function onDie(self)
local x , y = getForward( ( self.facing + 2 ) % 4 )
x = x + self.x
y = y + self.y
if killcounter:getValue() == 1 then
if not isWall( self.level , x , y ) then
spawn("spider",party.level,x,y,self.facing)
end
elseif killcounter:getValue() == 2 then
sd1:open()
---- Here I want to call (function addMoney) from the (rewardslvl1) Script in the Editor (see Below) --
end
end
1 - Script Entity Name: rewardslvl1
2 - The Script function I want to call: (its from the Shop Frame work, Magnus wrote)
function addMoney()-- adds money to the party
hudPrint("Guard: Good show! Here is an added bonus for cleaning the mess up! 20 Money added.")
gui.globalVars["totalMoney"] = gui.globalVars["totalMoney"] + 20
end
Thxs for any help..