Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I need help with a client sided part system please?

Asked by 1 year ago

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

Log in to vote
1
Answered by 1 year ago
Edited 1 year ago

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)
0
Hey! I have already tried this but it dont work for a part wDaerkfeX 37 — 1y
0
I edited my answer, try this code instead brandons2005 87 — 1y
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! wDaerkfeX 37 — 1y
0
edited again, fingers crossed it actually works now brandons2005 87 — 1y
0
Ty a lot! wDaerkfeX 37 — 1y
Ad

Answer this question