Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I need help with a client sided part system please?

Hi! I am currently trying a system where when a player touches a part it becomes and stays green and the other players do not see what has become green (they see its initial color in white). So I created a script and in it I put this:

local part = script.Parent
local player = game.Players.LocalPlayer

game.Players.PlayerAdded:Connect(function(player)
    part.Touched:Connect(function(Hit)
        script.Parent.BrickColor = BrickColor.new("Lime green")
    end)
end)

my problem now is that everyone sees when the part changes color. Thank you in advance for your help!

1 answer

✓ Accepted answer

All you'll need to do is make this a localscript instead, which will run on each client's side rather than the server's side. Do inform us if it still doesn't work though

edit: try using this in StarterPlayerScripts. set part to which ever part you want to set the color of

local part = workspace.Part
local player = game.Players.LocalPlayer

part.Touched:Connect(function(Hit)
	if Hit.Parent.Humanoid and Hit.Parent.Humanoid == player.Character.Humanoid then
		part.BrickColor = BrickColor.new("Lime green")
	end
end)

5 comments

0

Hey! I have already tried this but it dont work for a part

0

I edited my answer, try this code instead

0

Hey, Ty for your help! I have putted this script and replaced the name of the part but it seems like it still dont work: there a video: https://streamable.com/vaznbi Ty in advance for your help!

0

edited again, fingers crossed it actually works now

0

Ty a lot!

This discussion is preserved as it was. New answers, comments, and votes are closed.