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

Help me please? this script has an error, and I can't fix it.

This script is broken, and it's supposed to remove the script when a player dies, but the error is > Unexpected symbol near '='

game.Players.PlayerAdded:connect(function(plr)

plr.CharacterAdded:connect(function(char)

local var = 0

repeat

wait(0.01)

local ifs = char.Humanoid
--Edited Part
if ifs=0 then

plr.Backpack.LinkedSword.SwordScript:Destroy()

until var==10

end)

end)

1 comment

0

The error is on line 13.

2 answers

Missing 'end' and '==' on line 13.

game.Players.PlayerAdded:connect(function(plr)
	plr.CharacterAdded:connect(function(char)
		local var = 0
		repeat wait() -- 2/30th of a frame.
		local ifs = char.Humanoid
			if ifs == 0 then
				plr.Backpack.LinkedSword.SwordScript:Destroy()
			end
		until var == 10
	end)
end)

I think you are trying to compare it, on line 13, am I correct? If so then you would use ==instead of =.

Hope I helped.

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