✓ Accepted answer
If the problem is the same as in this question from 2 days ago, then the reason it didn't work is that you didn't actually fire the RemoteEvent. (call the FireServer method). This is how you would use a RemoteEvent.
Also, like the other answer said, always test on Server mode, as Using the blue "Play" button is unreliable, and is an inaccurate representation of what would happen in online mode, (when people will actually play your game) with Servers and Clients, which is why people get the "works in studio, but not in game" issue.
The following method would work, provided that there is a RemoteEvent in the ReplicatedStorage called "Team Change", which, as you said, is true. However, to make things easier, it's best not to name things with spaces. That being said though, this way would work with "Team Change"
In a Script in the ServerScriptService
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local createPartEvent = ReplicatedStorage:WaitForChild("Team Change")
createPartEvent.OnServerEvent:Connect(function(player,teamcolor)
player.TeamColor = teamcolor
end)
In the LocalScript inside the GUI
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local createPartEvent = ReplicatedStorage:WaitForChild("Team Change")
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
createPartEvent:FireServer(BrickColor.new("Black"))
end)
1 comment
thank you! i hope you play my obbys one day to show the work you've helped me with ;)