Jump to content

Recommended Posts

Posted

Every time I try to run my game it gives me an error saying "expected then near ="

this is my program (I'm sure there's lots of other bugs). I'm still very new to lua, so I wouldn't be too surprised if it's something really simple.

 

 

Script.Damage = 0 --int "Damage per interval"

Script.Interval = 0 --int "Damage Interval"

Script.Safety = false --bool "safe"

 

function Script:Collision(entity, position, normal, speed)

if(entity:GetKeyValue("Safe") == true) then

self.saftey = true

else

self.safety = false

end

end

 

function Script:UpdateWorld()

if self.saftey == false

if(DamTaken == true)then

DamInt = Time:GetCurrent() + self.Interval

end

Now = Time:GetCurrent

if DamInt < Now then

NewHealth = (entity:GetKeyValue("health")) - self.Damage

entity:SetKeyValue("health") = NewHealth

end

end

end

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...