I’ve tried making a team change GUI where you spawn into the game, and you are looking over a baseplate. That bit works, but when you change your team I want the camera manipulation to go away and the player to be in normal camera mode. Instead though when you change your team you are still looking over that same baseplate and you can’t even see your player. I’ve tried fixing it but to no avail. Here is the script:
local TeamChoose = script.Parent.Parent
local confirm = script.Parent.Parent.Teamchange.Frame.Light.Button
local confirm2 = script.Parent.Parent.Teamchange.Frame.Dark.TextButton
local Camera = game.Workspace.CurrentCamera
local Player = game.Players.LocalPlayer
repeat wait() until Player.Character
repeat wait()
Camera.CameraType = Enum.CameraType.Scriptable
until Camera.CameraType == Enum.CameraType.Scriptable
Camera.CFrame = game.Workspace.CamPart.CFrame
confirm.MouseButton1Click:Connect(function()
Camera.CameraSubject = Player.Character:WaitForChild("Humanoid")
end)
confirm2.MouseButton1Click:Connect(function()
Camera.CameraSubject = Player.Character.Humanoid
end)
Thanks for your help.
NOTE: I get absolutely no errors.
Would it be worth me adding my team change script as well to this? Well here it is. There are two of these scripts, one for each team.
local Camera = game.Workspace.CurrentCamera
local player = script.Parent.Parent.Parent.Parent.Parent
local TeamChoose = script.Parent.Parent
local Player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
script.Parent.TextButton.Visible = false
script.Parent.TextButton.Visible = true
end)
script.Parent.TextButton.MouseButton1Click:Connect(function()
player.Team = game.Teams.Dark
TeamChoose:TweenPosition(UDim2.new(0.25, -0,-1, -0),"Out","Quint",1,true)
player.Character.Humanoid.Health = 0
end)
Does the script run whenever the player is spawned? That’s probably the problem. I haven’t worked with teams, but why do you need to reset the player to change the team? If you need to respawn the player on a spawn pad, it would be easiest just to set the CFrame of their HumanoidRootPart then, or change your camera script not to run every time the player spawns
EDIT: By “the script” I meant the camera script in the first sentence
In the camera script, you could only set the camera to orbit the baseplate if the player doesn’t have a team. I believe there’s a Player.Team property?
For example, the script could only run if the player’s team is nil.
Well, it does say that when you are on no team you are on the “neutral” team by default. How would I go about making it that the camera manipulation only happens when you are on the neutral team?
For the camera script Im using a local script in a screen Gui inside starter Gui and for the team one its a script in a textbutton, which is in a frame, which is in a screenGUI which is in starter gui