So yeah, this script works in studio but it doesnt work in game.. Help pls?!
local button = script.Parent local votes = script.Parent.votes local touches = {} while true do wait() for i,v in pairs(game.Players:GetChildren()) do if v.Character:FindFirstChild("LowerTorso") ~= nil and (v.Character.LowerTorso.Position - button.Position).magnitude <=5 and v.Character.LowerTorso:FindFirstChild("antispam") == nil then local value = Instance.new("BoolValue") value.Parent = v.Character.LowerTorso value.Name = "antispam" print("in") votes.Value = votes.Value + 1 elseif v.Character:FindFirstChild("LowerTorso") ~= nil and (v.Character.LowerTorso.Position - button.Position).magnitude > 5 and v.Character.LowerTorso:FindFirstChild("antispam") ~= nil then v.Character.LowerTorso.antispam:Destroy() votes.Value = votes.Value - 1 end end end
Thx :P