Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What is wrong with how KeyboardMouse is not a 'EnumItem'? [Solved]

Asked by 4 years ago
Edited by Ziffixture 4 years ago

The script with error (error at near end part):

local plr = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
local mainMenuMap = workspace:WaitForChild("MainMenuMap")
local tweenService = game:GetService("TweenService")
local btn = script.Parent

function tweenCamera(pos,tweenTime)
    tweenService:Create(camera,TweenInfo.new(tweenTime,Enum.EasingStyle.Linear),{CFrame = pos.CFrame}):play()
end

btn.MouseButton1Click:Connect(function()
    btn.Visible = false
    btn.Parent.Title.Visible = false
    btn.Parent.CreditButton.Visible = false

    repeat wait()
    camera.CameraType = Enum.CameraType.KeyboardMouse
until camera.CameraType == Enum.CameraType.KeyboardMouse
camera.CFrame = workspace.Camera.CFrame

end)
0
I have the answer already! EpicLLBro 11 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago
Edited by Ziffixture 4 years ago
local plr = game.Players.LocalPlayer local camera = workspace.CurrentCamera local mainMenuMap = workspace:WaitForChild("MainMenuMap") local tweenService = game:GetService("TweenService") local btn = script.Parent

function tweenCamera(pos,tweenTime) tweenService:Create(camera,TweenInfo.new(tweenTime,Enum.EasingStyle.Linear),{CFrame = pos.CFrame}):play() end

btn.MouseButton1Click:Connect(function() btn.Visible = false btn.Parent.Title.Visible = false btn.Parent.CreditButton.Visible = false

repeat wait()
camera.CameraType = Enum.CameraType.Custom
until camera.CameraType == Enum.CameraType.Custom camera.CFrame = workspace.Camera.CFrame

end)


Ad

Answer this question