So this is suppose to function when the puck is covered and then the name changes. script:
while true do wait(0.1) if game.Workspace.Puck.Name == 'glovedpuck' then game.Workspace.glovedpuck.Anchored = true game.Workspace.GameSounds.Whistle:Play() end end
This may work. I have tested it and it worked.
local Puck = workspace.Puck local Whistle = workspace.GameSounds.Whistle Puck.Changed:Connect(function(property) if property == Name and Puck.Name == "glovedpuck" then Puck.Anchored = true Whistle:Play() end end)
-Arvid
You could use .Changed to detect the name change, for example:
script.Parent.Changed:Connect(function(ChangedProperty) if ChangedProperty = "Name" then -- Detect if the changed property is name if game.Workspace.Puck.Name == 'glovedpuck' then script.Parent.Anchored = true -- I would recommand u to put this script inside the part game.Workspace.GameSounds.Whistle:Play() end end end) -- Remember the ) !