I made a FE team change script for my Sci-Fi space lab today, and.. It seems to not work.

Third Try [i had some previous attempts]

local Researcher = script.Parent.Researcher
local Security = script.Parent.Security
local player = game.Players.LocalPlayer

Researcher.MouseButton1Click:Connect(function()
	player.Team = game.Teams.Researcher
	game.ReplicatedStorage.Events.PlayerEvent:FireServer()
end)

Security.MouseButton1Click:Connect(function()
	player.Team = game.Teams.Security
		game.ReplicatedStorage.Events.PlayerEvent:FireServer()
end)

^ FE Team Script ^ v On Server Event v

local r = game:GetService("ReplicatedStorage")
local SEC = r.Events.TeamEvents.Security
local RES = r.Events.TeamEvents.Researcher

local playeradded = r.Events.ClientCon

game.Players.PlayerAdded:Connect(function(player)
	wait()
	playeradded:FireClient(player)
end)

SEC.OnServerEvent:Connect(function(splayer)
	splayer.TeamColor = BrickColor.new("Deep orange")
end)

RES.OnServerEvent:Connect(function(splayer)
	splayer.TeamColor = BrickColor.new("Cyan")
end)

Problem, it doesn't change my team without erroring.

9 comments

0

you cant get the server storage from the client

0

Oh.. How can i make it work correctly & functional?

1

use ReplicatedStorage instead, since it can be accessed by the client and server so its the best place to put remote events and functions

0

^ Ill try that.

0

you need to show us your OnServerEvent code

0

^ I didn't add that.

0

If it's throwing an error then post it

0

It isnt erroring.

0

Ok then check if it's running at all. Print something on line 1, if it's not it's either disabled or misplaced.