Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

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

Asked by 10 years ago

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)
0
The error is on line 13. Wrongmistake 0 — 10y

2 answers

Log in to vote
1
Answered by
Dummiez 360 Moderation Voter
10 years ago

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)

Ad
Log in to vote
0
Answered by 10 years ago

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.

Answer this question