script.Parent.Touched:Connect(function(part)
if debounce == false then
debounce = true
local player = players:GetPlayerFromCharacter(part:FindFirstAncestorWhichIsA("Model"))
if player then
player:SetAttribute("Buildmode" , false)
end
debounce = false
end
end)
My problem is that the value does not change despite no errors showing up in the output and the script being a ServerScript
Is this a local script or a global one?
If its a local one the attribute will change, but only for the local player, and not for the server or anyone else.
script.Parent.Touched:Connect(function(part)
local h = part.Parent:FindFirstChildOfClass("Humanoid")
if debounce or not h then return end
debounce = true
local player = game.Players:FindFirstChild(player.Name)
if player then
player:SetAttribute("Buildmode" , false)
end
debounce = false
end
end)