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

Is it possible to make a part in the workspace look different for each player?

I'm doing a mini-game where players can equip skins. In the lobby I wanted to set up statues that show each player their own skin I tried this:

local player = game.Players.LocalPlayer
wait (0.1)
while true do
	wait (1)
	if game.Players.LocalPlayer.Backpack.Skins.Weapons.AK12.Value == 1 then
	script.Parent.Parent.Parent.BrickColor = BrickColor.new("Bright blue")
	script.Parent.Parent.Parent.Material = ('SmoothPlastic')
end
end

but obviously it does not work because a script has no local player

1 comment

0

Describe your problem a little more. What does the script more, and add more detail to what you want to achieve

1 answer

✓ Accepted answer

Client-Server Replication

With FilteringEnabled, LocalScripts have great importance. A LocalScript cannot access top-level services such as ServerScriptService, HttpService, etc. Aswell as changes made to the client are NOT replicated to the server. This will allow us to make weapon

See this setup. Assume I have a LocalScript in StarterPlayerScripts to change a brick's color, I want Player1 to have a green brick, and Player2 to have a blue brick. I can do the following code:

local plr = game.Players.LocalPlayer

if plr.Name == "Player1" then
	game.Workspace.Brick.BrickColor = BrickColor.new("green")
end

if plr.Name == "Player2" then
	game.Workspace.BrickColor = BrickColor.new("blue")
end

Player1 would see Brick as green, and Player2 as blue. You can use this same setup for skins, changing it's physical properties aswell as it's size, rotation, etc.

Note that It has to be in a LocalScript!!. If it's in a ServerScript then it'll be replicated to EVERY player.

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