Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is this script not working?

So I have a script. If the person is on fire, they lose health, then die. But the output says 20:08:59.458 - Workspace.Script:1: 'then' expected near '='. Why?

if Effects.Fire = true then
	wait(5)
	game.Workspace.USERNAME.Humanoid.Health = 5
	wait(4)
	game.Workspace.USERNAME.Humanoid:Destroy()
end

2 answers

When comparing two things, you use the == operator. Compare two statements like this:

if Effects.Fire == true then
if Effects.Fire == true then
wait(5)
game.Workspace.USERNAME.Humanoid.Health = 5
wait(4)
game.Workspace.USERNAME.Humanoid:Destroy()
end

You need the "==" because your comparing. In other situations you might need a "~="

if (humanoid ~= nil) then

I used the "()" in it. You don't have to.

This discussion is preserved as it was. New answers, comments, and votes are closed.