Can someone help me with a problem in this script?
Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
Can someone help me with a problem in this script? The problem is that when I made a "Spamlimit", it only made it for how many times you could heal. It would break every time I said "heal/", even if it was not past the spam time. Could someone fix this error please? Here's the script:
06 | game.Players.PlayerAdded:connect( function (p) |
07 | p.Chatted:connect( function (msg) |
08 | if msg:lower() = = "heal/" then |
09 | if playerlist [ p ] ~ = true and (playerlist [ p ] = = nil or playerlist [ p ] [ spamlimit ] = = nil or playerlist [ p ] [ spamlimit ] - playerlist [ p ] [ 1 ] > = spamtime) then |
10 | p.Character.Humanoid.Health = p.Character.Humanoid.MaxHealth |
11 | if playerlist [ p ] = = nil then |
14 | if playerlist [ p ] [ spamlimit ] then |
15 | for i = 1 , #spamlimit - 1 do |
16 | playerlist [ p ] [ i ] = playerlist [ p ] [ i + 1 ] |
18 | playerlist [ p ] [ spamlimit ] = tick() |
20 | table.insert(playerlist [ p ] , tick()) |
22 | elseif playerlist [ p ] ~ = true then |