How do I get this script in a gui in StarterGui (specifically at line 9)...

function click(char)
	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))				
		end
	end
	--here
	script.Parent.Parent.Parent:Remove()	
end
script.Parent.MouseButton1Click:connect(click)

to start this function in a script in ServerSciptService?

game.Players.PlayerAdded:Connect(function(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)

2 comments

1

look into remote events and remote functions

0