In my game a function allows users to morph into a model then colour those model parts using this script. It works fine in testing mode and in Online mode, but once players reset the coloring script stops working altogether.
I think it may be the character added function but I don't know how to force it to refresh even after the player resets. Any suggestions?
local player = game.Players.LocalPlayer
local character = player.CharacterAdded:wait()
repeat wait() until repeat wait() until player.CharacterAdded:connect(function() loaded = true end)
script.Parent.MouseButton1Click:connect(function()
local Get = character:GetChildren()
for i = 1, #Get do
if Get[i].ClassName == "Model" then
local Gget = Get[i]:GetChildren()
for i = 1, #Gget do
if Gget[i].Name == script.Parent.Parent.Parent.Parent.Target.Value then
Gget[i].BrickColor = BrickColor.new(script.Parent.Name)
end
end
end
end
end)
Thankyou very much

4 comments
repeat wait() until twice?
But thankyou so much from the entire team we have been trying to fix this for so long =.=
Your script does repeat wait() until twice; it's probably not necessary but I included it anyway.
Oh Im sorry, I wasnt using this script in game so I hadnt noticed my mistake. Many thanks nonetheless