Why isn't this working properly?

This localscript is in a Part in workspace. It doesn’t display any errors, nor the print. All the data (paths to values) work. I just need it to go invisible for the player who has claimed all their coins.

while true do
wait()
if game.Players.LocalPlayer.Round.Collected_Coins.Value >= 50 then
print(“Made it here.”)
script.Parent.Spin:Destroy()
repeat
script.Parent.Transparency = script.Parent.Transparency + 0.025
wait(0.01)
until script.Parent.Transparency == 1
script:Destroy()
end
end

Thanks!

1 Like

LocalScripts do not run in the workspace if they are not in a Client’s Character model. Refer to the wiki on them to see where they’ll run. If you were to put that script in StarterPlayerScripts and change the script.Parent to the part via workspace.Part then it would work.

2 Likes

Alrighty, Thank you for that!!