I am trying to make a team changer where you hit the job and ui pop up. Then if you hit get tag it. switches your team to that job.
All of this works accept the tag does not change. It will only appear on the client’s side, not for the whole server. It will only appear on client, because it’s in StarterCharacterScripts where LocalScripts are supposed to be.
They way to do this is to place a Script (not a LocalScript) in Workspace or ServerScriptService
How do I make this in to a server script?
-- SERVER SCRIPT INSIDE STARTERCHARACTERSCRIPTS
---> services
local char = script.Parent
local plr = game.Players:GetPlayerFromCharacter(char)
---> variables
local NameTagClone = game.ServerStorage.HeadUI:Clone()
---> main
NameTagClone.Parent = char.Head
NameTagClone.Adornee = char.Head
NameTagClone.UI.NameUI.NameName.Text = char.Name
if plr.Team == nil then
NameTagClone.UI.RankUI.RankName.Text = "Player"
end
repeat wait() until plr.Team ~= nil
NameTagClone.UI.RankUI.RankName.Text = plr.Team.Name
char.Humanoid.DisplayDistanceType = "None"
game:GetService("RunService").Heartbeat:Connect(function()
NameTagClone.UI.RankUI.RankName.Text = plr.Team.Name
end)
yes you use :fireserver(info) as an event and then .onserverevent:connect(function(player, info) as a listener, you can send tables or multiple arguments