This script (not local) from a gui in StarterGui is trying to call (line 11)...
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RE = ReplicatedStorage:WaitForChild("GiveName")
function click(Player)
local t = game.Teams[script.Parent.Text]
script.Parent.Parent.Parent.Parent.Parent.Parent.TeamColor = t.TeamColor
local spawns = game.Workspace.SpawnLocations:GetChildren()
for i=1, #spawns do
if spawns[i].TeamColor == t.TeamColor then
script.Parent.Parent.Parent.Parent.Parent.Parent.Character:MoveTo(spawns[i].Position + Vector3.new(0,10,0))
RE:FireClient(Player)
end
end
script.Parent.Parent.Parent:Remove()
end
script.Parent.MouseButton1Click:connect(click)
...this function from a script from ServerScriptService but is not working. What I am I doing wrong?
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RE = ReplicatedStorage:WaitForChild("GiveName")
function namer(plr)
plr.CharacterAdded:Connect(function(char)
local nameGui = Instance.new("BillboardGui")
nameGui.StudsOffset = Vector3.new(0, 1.5, 0)
nameGui.MaxDistance = 30
nameGui.Size = UDim2.new(0, 200, 0, 50)
nameGui.Name = "NameGui"
nameGui.Parent = char.Head
local nameLabel = Instance.new("TextLabel")
nameLabel.Text = plr.Name
nameLabel.TextStrokeTransparency = 0
nameLabel.TextScaled = true
nameLabel.Font = "Fantasy"
nameLabel.Size = UDim2.new(0, 200, 0, 50)
nameLabel.BackgroundTransparency = 1
nameLabel.TextColor3 = plr.TeamColor.Color
nameLabel.Name = "NameLabel"
nameLabel.Parent = nameGui
end)
end
RE.OnServerEvent:Connect(namer)

2 comments
@DesertusX Thank you but it didn't work :(
Sorry.