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

4 comments

0

error?

0

nop

0

There doesn't seem to be any issues with this code, it may be an error in another script

0

Well I pasted the script in a empty place and it still doesnt work in game, rest im macarnois