My Team Change GUI seems to work very well in Studio, but not so much in-game, where it becomes a medium for useless text buttons. Also, the teleportation part just teleports me out of the map. (Filtering Enabled)

--- localscript

wait(0.25)

local localscript = game.ReplicatedStorage.Scripts:WaitForChild("RequestToChangeTeam")

local function onClick()
	
	print("hi5")
	localscript:FireServer(BrickColor.new("Bright blue"),-226.2, 513.8, -339.6)
	
end

script.Parent.MouseButton1Click:connect(onClick)

--- server script
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local teamevent = game.ReplicatedStorage.Scripts:WaitForChild("RequestToChangeTeam")
local function ChangeTeam(player,color,pos)
	
	print("hi6")
	local Gui = player.PlayerGui:WaitForChild("TeamChoosing")
	player.TeamColor = color
	game.Workspace:FindFirstChild(player.Name).Torso.CFrame = CFrame.new(Vector3.new(pos))
	Gui.Frame.Visible = false


end

teamevent.OnServerEvent:Connect(ChangeTeam)


1 comment

0

Try pressing F9 and see what errors there are. Also change pos to ... as a single variable cannot hold more than one value.