I want to make this script change a value for a datastore and change the color of the part. I have been posting a lot of questions but I think this one is the last for now.
whenever I try to run the script nothing happens. the value doesn't change and neither does the color.
here is the script (local but I could change it to nonlocal I think.)
Gravel = workspace.Things.gravel Button = script.Parent function color(player) local ColorNum = player.DataFolder.GravelColor.Value Gravel.BrickColor = BrickColor.new("Cyan") ColorNum = 3 end game.Players.PlayerAdded:Connect(function(player) while true do color(player) wait(0.2) end end)
Any idea on how to fix this?
HEYO, I remember you on the other comment and you said it was a local script, so I updated my script so it could fit. Remove the playeradded event and just use LocalPlayer
while true do color(game.Players.LocalPlayer) wait(.2) end
SORRY IF I CONFUSED YOU ON THE OTHER QUESTION