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

How do you fix the attemp to call a nil value error?

Asked by 4 years ago
Edited 4 years ago

Players.julienblox123b.PlayerGui.ScreenGui.IntroFrame.PlayButton.PlayClient:8: attempt to call a nil value

can someone help me fix this?

Script:

-- Variables for the script to think that these locals are useful
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

    tweenCamera(mainMenuMap.CameraPart2,1)
    wait(1)
    print("Reached Destination")
end)

1 answer

Log in to vote
0
Answered by 4 years ago

Nvm. Fixed. i needed to captipalize the new lol

0
mark it as solved VerdommeMan 1479 — 4y
Ad

Answer this question