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

Can someone help me with a problem in this script?

Asked by 11 years ago

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:

01local spamlimit = 3
02local spamtime = 0.4 -- if spamlimit is reached within this time, the cooldown is activated
03local cooldown = 5
04local playerlist = {}
05 
06game.Players.PlayerAdded:connect(function(p)
07p.Chatted:connect(function(msg)
08if msg:lower() == "heal/" then
09if playerlist[p] ~= true and (playerlist[p] == nil or playerlist[p][spamlimit] == nil or playerlist[p][spamlimit] - playerlist[p][1] >= spamtime) then
10p.Character.Humanoid.Health = p.Character.Humanoid.MaxHealth
11if playerlist[p] == nil then
12playerlist[p] = {}
13end
14if playerlist[p][spamlimit] then
15for i = 1, #spamlimit - 1 do
View all 29 lines...

1 answer

Log in to vote
0
Answered by 11 years ago

Yes, you didn't say what to do with local spamtime. All it says is thats its value, so when the command is entered, in the output, it just lists that value. I hope I'm right, lol.

Ad

Answer this question