I have three problems:
I can't teleport players correctly, sometimes they still spawn in the original spawn point and would take several clicks before he teleports into the right one.
Debounce won't work, you can still keep on teleporting.
Error at line "player.Character.Torso.CFrame" expected CFrame, given Vector3.new("") value.
ClassHolder = script.Parent
ct = ClassHolder.CounterTerrorists
t = ClassHolder.Terrorists
ctspawn = game.Workspace.ctspawn --spawnpoint
tspawn = game.Workspace.tspawn --spawnpoint
Spectators = game.Workspace.Spectators
player = game.Players.LocalPlayer
Teamjoined = false
ct.MouseButton1Down:connect(function()
if Teamjoined == false then
player.TeamColor = BrickColor.new('Really blue')
player.Character.Torso.CFrame = Vector3.new(ctspawn.Position.X,ctspawn.Position.Y + ctspawn.Size.Y / 2 + 7,ctspawn.Position.Z)--This line Error CFrame expected
player:LoadCharacter()
ClassHolder.Visible = false
Teamjoined = true
elseif Teamjoined == true then
print('You already joined a team')
end
end)
t.MouseButton1Down:connect(function(t)
if Teamjoined == false then
player.TeamColor = BrickColor.new('Really red')
player.Character.Torso.CFrame = Vector3.new(tspawn.Position.X,tspawn.Position.Y + tspawn.Size.Y / 2 + 7,tspawn.Position.Z)--This line Error CFrame expected
player:LoadCharacter()
ClassHolder.Visible = false
Teamjoined = true
elseif Teamjoined == true then
print('You already joined a team')
end
end)

2 comments
Error line at 14 and 26: Players.Player1.PlayerGui.ScreenGui.ClassHolder.LocalScript:26: attempt to call global 'CFrame' (a table value)
weird... It works when I try it...