I want to make it so when a Player hits a brick, it gives them 1 Player Point, not 8... Anyways, here's the script.
local buttonPressed = false local How_Much_To_Award = 1 -- How much Player Points to award. script.Parent.Touched:connect(function(plr) if not buttonPressed then buttonPressed = true end wait() local i = plr.Parent.Name if plr.Parent:findFirstChild("Humanoid") then print(plr.Parent.Name) game:GetService("PointsService"):AwardPoints(game.Players:findFirstChild(i).userId, How_Much_To_Award) buttonPressed = false print("Done.") end end)
You don't actually have anything to keep it from running if buttonPressed is true
local buttonPressed = false local How_Much_To_Award = 1 -- How much Player Points to award. script.Parent.Touched:connect(function(plr) if buttonPressed == true then return end -- Causes the function to end here if buttonPressed is true buttonPressed = true wait() local i = plr.Parent.Name if plr.Parent:findFirstChild("Humanoid") then print(plr.Parent.Name) game:GetService("PointsService"):AwardPoints(game.Players:findFirstChild(i).userId, How_Much_To_Award) buttonPressed = false print("Done.") end end)