so i made a character customization gui and put it on a local script in starter gui : local Pants1 = game.Players.LocalPlayer.Character:WaitForChild('Pants') script.Parent.Parent.MouseButton1Down:Connect(function() Pants1.PantsTemplate ='http://www.roblox.com/asset/?id=157717721' it works but the others cant see that change nor i can see theirs , any solutions Please?
So you've just encountered a problem with
Remote Events
Remote Events And Functions are a way for the Client to Communicate withe the Server.
The Client is the stuff on your screen any changes made with a LocalScript can only be seen on your screen, However if the changes were made with a Server Script Everyone will see the change on their screen instead of you alone, but it has to be in the a location of the game that can interact with the Server aka Not your player. A good location to put Server Scripts is the ServerScriptsService
Now what you want to do is create a local script somewhere within places that have something to do with the Client For ex lets say I put mine in the StarterCharacterScripts and I want to fire and event to communicate with the Server so not only will I see it everyone will
For this example ill be creating a part when i press a key
local Event = game.ReplicatedStorage:WaitForChild("RemoteEvent")
game:GetService("UserInputService").InputBegan:Connect(functionKey, IsChatting)
if key.KeyCode == Enum.KeyCode.R and not IsChatting then
Event:FireServer(key.KeyCode)
end
end)
loca event == instance.new("RemoteEvent") event.Parent = game.ReplicatedStorage event.OnServerEvent:Connect(function(Player, Arg) --So you can send over arguements(Pieces of data that you want the Server to recieve, but keep in mind the Player is always the 1st Argument print(Arg) -- Arg in this case would be the Key.KeyCode fired in the parameter of the local script local part == instance.new("Part") part.Anchored = true part.CFrame = Player.Character.HumanoidRootPart.CFrame * CFrame.new(0,0,-5) part.Parent = game.Workspace end)
So when you press R a brick will Tell the Client to send information to the Server to create the brick
Also the Events Can go to the Client from the Server but thats another story https://developer.roblox.com/articles/Remote-Functions-and-Events