local Gate = game.Workspace.OwOMachine3000.Tunnel.Section3["3rdScanner"].LaserGate local players = game:GetService("Players") Gate.Touched:Connect(function(hit) if hit and hit.Parent:FindFirstChild("Humanoid") then local Char = hit.parent --this contains all the character limbs local Name = Char.Name local head = Char.Head local hair = Char["Brown Hair"] local plr = players[Name] print("plr") wait(5) for i,v in pairs(Char:GetChildren()) do if v:IsA("MeshPart") then v.Color = Color3.new(1, 1, 1) head.Color = Color3.new(1, 1, 1) hair.Parent = game.ServerStorage end end end end)
This is a script I've got that is supposed to change the colour of all the body parts and remove the hair when the Client touches a brick, it works perfectly in Studio and in a Local Server but when I play the game on Roblox it only changes the head colour and nothing else, and the hair stays on the character, does anyone know why this is?
Put this script into the LaserGate, You used a LocalScript on something that should be Serversided.
local Gate = script.Parent local players = game:GetService("Players") local SS = game:GetService("ServerStorage") Gate.Touched:Connect(function(hit) if hit and hit.Parent:FindFirstChild("Humanoid") then local Char = hit.parent --this contains all the character limbs local Name = Char.Name local head = Char.Head local hair = Char["Brown Hair"] local plr = players[Name] print("plr") wait(5) for i,v in pairs(Char:GetChildren()) do if v:IsA("MeshPart") then v.Color = Color3.fromRGB(255,255,255) head.Color = Color3.fromRGB(255,255,255) hair.Parent = SS end end end end)
for i,v in pairs(Char:GetChildren()) do if v:IsA("Part") then v.Color = Color3.new(1, 1, 1) hair.Parent = game.ServerStorage end end