Other people can't see the torso change color? {Pls Help}

Nobody else in the server can see the torso change color, probably because the code is in a local script in StarterGui but how could I convert it to a serverscript?

while true do 
	local RColor = script.Parent.RedBar.SliderValue.Text
	local GColor = script.Parent.GreenBar.SliderValue.Text
	local BColor = script.Parent.BlueBar.SliderValue.Text

	local player = game.Players.LocalPlayer
	repeat wait() until player.Character
	local BC = player.Character:WaitForChild("Body Colors")

	BC.TorsoColor3 = Color3.fromRGB(RColor,GColor,BColor)
end
2 Likes

theres not much context on what youre trying to do

1 Like

ah sorry, I will show a video.

1 Like

send the color values to a server script through a remote event and just change it on the server

create a remote event in replicated storage

create a server script in serverscriptservice and paste this there:

local Remote = game:GetService("ReplicatedStorage").RemoteEvent

Remote.OnServerEvent:Connect(function(Caller, R, G, B)
	
	Caller.Character:WaitForChild("Body Colors").TorsoColor3 = Color3.fromRGB(R, G, B)
end)

and replace your local script with this:

local Remote = game:GetService("ReplicatedStorage").RemoteEvent

while true do 
	local RColor = script.Parent.RedBar.SliderValue.Text
	local GColor = script.Parent.GreenBar.SliderValue.Text
	local BColor = script.Parent.BlueBar.SliderValue.Text
	
	Remote:FireServer(RColor, GColor, BColor)
end
2 Likes

Basically, I can change the color of my character to be whatever I want it to be:

But other players can’t see that I am changing my body colors.

3 Likes

use a remote and make sure it puts the color and then set player’s torso color

1 Like

Got a confusing error…

Script timeout: exhausted allowed execution time

for this line:

Remote:FireServer(RColor, GColor, BColor)
1 Like

because you’re firing the remotevent too much, add a cooldown in the loop

1 Like

add a wait to ur remote event. you cant fire every nano second

1 Like

quinn i want to genually just recommend you go watch a tutorial on the basics, you can easily find a fix you just dont know how to do the basics

i can provide some videos about this tropic if it so helps

1 Like

and having a loop is inefficient anyways, you should instead rely on .Changed events

meant to say topic * my bad on typo

If you know how to use .Change that would be great for starters.

I wouldn’t really call myself a beginner as I wrote all this but I have never used .Change before and adding the wait completely flew over my head.