Hello there users of devforum. I have made this script where you click a button and it’ll show a list of teams to join. Although So far it has worked. The camera script to change to the player when the player clicks a team doesn’t work and instead just returns to the part thats the camera.
I have tried re-arranging the code and more but none work so far. Any help/feedback?
Local Script
local RemoteEvent = game.ReplicatedStorage.TeamChange
local menubutton = script.Parent.IngameMenu:WaitForChild("MenuButton")
local menuchange = script.Parent.Frame
local frame = script.Parent:WaitForChild("Frame")
local gui = script.Parent
local PlayBtn = gui.PlayBtn
local ClassD = "Deep orange"
local MTF = "Bright blue"
local Security = "Pearl"
local camera = workspace.CurrentCamera
repeat
wait()
camera.CameraType = Enum.CameraType.Scriptable
print(camera.CameraType)
until camera.CameraType
camera.CFrame = workspace.CameraFocusPart.CFrame
PlayBtn.MouseButton1Click:Connect(function()
menuchange.Visible = true
end)
menuchange.Visible = false
script.Parent.IngameMenu.Visible = false
menubutton.MouseButton1Click:Connect(function()
menuchange.Visible = true
end)
frame["Class-D"].CD.MouseButton1Click:Connect(function()
RemoteEvent:FireServer(BrickColor.new(ClassD))
menuchange.Visible = false
camera.CameraType = Enum.CameraType.Custom
end)
frame.Security.SD.MouseButton1Click:Connect(function()
RemoteEvent:FireServer(BrickColor.new(Security))
menuchange.Visible = false
end)
frame.MTF.MobileTask.MouseButton1Click:Connect(function()
RemoteEvent:FireServer(BrickColor.new(MTF))
menuchange.Visible = false
end)