Part transparency not showing for other players

So I made these Boots that have a neon line on them indicating that the boots are on and if they’re off then the line transparency is 1 but it only changes transparency on the client screen and not for other players. I am still learning to script so I don’t know much about remote events. I know I have to use a remote event. How can I do it? This is my local script in starterCharacterScript:

local userInputService = game:GetService("UserInputService")
local LBoot = script.Parent:WaitForChild("LeftBoot")
local RBoot = script.Parent:WaitForChild("RightBoot")

local LTransparency = LBoot.Neon.Transparency
local RTransparency = RBoot.Neon.Transparency


userInputService.InputBegan:Connect(function(input, gameProcessedEvent)
	if input.UserInputType == Enum.UserInputType.Keyboard then
		if input.KeyCode == Enum.KeyCode.B then
			if LBoot.Neon.Transparency == 0 and RBoot.Neon.Transparency == 0 then
				LBoot.Neon.Transparency = 1 
				RBoot.Neon.Transparency = 1
				game.Players.LocalPlayer.Backpack.Dash.Disabled = true
				LBoot.Bottom.Trail.Enabled = false
				RBoot.Bottom.Trail.Enabled = false
				script.BeepOff:Play()
				print("BootOff")
			else if LBoot.Neon.Transparency == 1 and LBoot.Neon.Transparency == 1 then
					LBoot.Neon.Transparency = 0
					RBoot.Neon.Transparency = 0
					game.Players.LocalPlayer.Backpack.Dash.Disabled = false
					LBoot.Bottom.Trail.Enabled = true
					RBoot.Bottom.Trail.Enabled = true
					script.BeepOn:Play()
					print("Boot On")
				end
			end
		end
	end
end)

If you change the property of a value in a local script it will stay local.

If you want the server to also see it use a RemoteEvent to change it on the server.

1 Like

Yeah I want it to show to everybody. But how would I do it? Do I make a server script? and FireClient() for the local script?

Yes, You would make a Remote Event with Arguments (The parts you want to change), Fire the event in the local script. And then Connect it with a function on a serverside script that changes the parts.

1 Like

A remote event already gets the player who fired it right? So I dont need to do Local PLayer =

Yes, RemoteEvents will call connected functions with the first argument being the player and the rest being any provided arguments. For example:

-- client
RemoteEvent:FireServer("hello world")

-- server
RemoteEvent.OnServerEvent:Connect(function(player,str) 
    print(player.Name,str)
end)
1 Like

I Made this:

Client:

local RemoteEvent = game.ReplicatedStorage.remotes.Boots
local userInputService = game:GetService("UserInputService")

userInputService.InputBegan:Connect(function(input, gameProcessedEvent)
	if input.UserInputType == Enum.UserInputType.Keyboard then
		if input.KeyCode == Enum.KeyCode.B then
			RemoteEvent:FireServer()
		end
	end	
end)

Server:

local RemoteEvent = game.ReplicatedStorage.remotes.Boots
local LBoot = script.Parent:WaitForChild("LeftBoot")
local RBoot = script.Parent:WaitForChild("RightBoot")

local LTransparency = LBoot.Neon.Transparency
local RTransparency = RBoot.Neon.Transparency

RemoteEvent.OnServerEvent:Connect(function(player,str) 
	print(player.Name,str)
	if LBoot.Neon.Transparency == 0 and RBoot.Neon.Transparency == 0 then
		LBoot.Neon.Transparency = 1 
		RBoot.Neon.Transparency = 1
		game.Players.LocalPlayer.Backpack.Dash.Disabled = true
		LBoot.Bottom.Trail.Enabled = false
		RBoot.Bottom.Trail.Enabled = false
		script.BeepOff:Play()
		print("BootOff")
else if LBoot.Neon.Transparency == 1 and LBoot.Neon.Transparency == 1 then
		LBoot.Neon.Transparency = 0
		RBoot.Neon.Transparency = 0
		game.Players.LocalPlayer.Backpack.Dash.Disabled = false
		LBoot.Bottom.Trail.Enabled = true
		RBoot.Bottom.Trail.Enabled = true
		script.BeepOn:Play()
		print("Boot On")
	end
	end					
end)

But it doesn’t print any errors or change the transparency even for the client.

What is the transparency of the neon? Your code will only toggle if the transparency of both boots is 1 or 0.

The Default transparency for the Neon is 0

local RemoteEvent = game.ReplicatedStorage.remotes.Boots
local LBoot = script.Parent:WaitForChild("LeftBoot")
local RBoot = script.Parent:WaitForChild("RightBoot")

local LTransparency = LBoot.Neon.Transparency
local RTransparency = RBoot.Neon.Transparency

RemoteEvent.OnServerEvent:Connect(function(player,str) 
	print(player.Name,str)
	if LBoot.Neon.Transparency == 0 and RBoot.Neon.Transparency == 0 then
		LBoot.Neon.Transparency = 1 
		RBoot.Neon.Transparency = 1
		game.Players.LocalPlayer.Backpack.Dash.Disabled = true
		LBoot.Bottom.Trail.Enabled = false
		RBoot.Bottom.Trail.Enabled = false
		script.BeepOff:Play()
		print("BootOff")
elseif LBoot.Neon.Transparency == 1 and LBoot.Neon.Transparency == 1 then
		LBoot.Neon.Transparency = 0
		RBoot.Neon.Transparency = 0
		game.Players.LocalPlayer.Backpack.Dash.Disabled = false
		LBoot.Bottom.Trail.Enabled = true
		RBoot.Bottom.Trail.Enabled = true
		script.BeepOn:Play()
		print("Boot On")
	end					
end)

This might work.

It didnt work. But I Added a print statement on the Client script to print fired when the player clicks B but it prints but doesnt fire:

local RemoteEvent = game.ReplicatedStorage.remotes.Boots
local userInputService = game:GetService("UserInputService")

userInputService.InputBegan:Connect(function(input, gameProcessedEvent)
		if input.UserInputType == Enum.UserInputType.Keyboard then
			if input.KeyCode == Enum.KeyCode.B then
			RemoteEvent:FireServer()
			print("Fired")
			end
		end
	end
)

Just figured out why - you’re still using game.Players.LocalPlayer in the server script. Replace it with the player variable.

1 Like

I think the problem is that I need the character model because in the server script LBoot and RBoot are defined as Script.parent?

But how would I define LBoot and Rboot? since they arent inside the function