I have a script here, it is quite short and self explanatory. It is currently a Client sided function under a LocalScript. However, the purpose I am using it for, requires it to be Server sided instead. How would I go about making this server sided?
Any help would be greatly appreciated. Thank you!
wait(1)
local Player = workspace:FindFirstChild(script.Parent.Name)
local P = game.Players.LocalPlayer
if not Player:FindFirstChild("Team") then
local value = Instance.new("StringValue")
value.Name = 'TEAM'
value.Parent = Player
value.Value = P.Team.Name
end

5 comments
ServerScriptService.Script:8: attempt to index global 'P' (a nil value)
I changed the script, I forgot to add 'P' as an argument on FireServer() function. LocalScript, line 10 has been changed.
The Player isn't passed as an argument to FireServer. and connect is deprecated, you should be using Connect.
Hm, P is still nil
Actually, I fixed it.