hi i have this code:
if TotalMoney==nil then
TotalMoney=0
end
function Script:Start()
if TotalMoney==nil then
TotalMoney=0
end
Totalmoney=Totalmoney+1
end
function Script:Release()
Totalmoney=Totalmoney-1
end
function Script:UpdateWorld()
self.entity:Turn(0,1.0*Time:GetSpeed(),0,true)
end
function Script:Collision(entity, position, normal, speed)
if entity.script then
if type(entity.script.CollectMoney)=="function" then
entity.script:CollectMoney()
if self.sound then
self.sound:Play()
end
self.entity:Hide()
end
end
end
function Script:Detach()
if self.sound~=nil then
self.sound:Release()
self.sound=nil
end
end
and my error is:
attempt to perform arithmetic on global 'Totalmoney' (a nil value)
can somone please help me