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

So why is this script not working? Something about not a valid member or something

Asked by 3 years ago

Hello! So I was following tutorials on how to make a main menu, but the script is not working. Can someone tell me why (also im not copying them im just using their script to learn off of it)

anyways, here is the script

local player = game.Players.LocalPLayer
local character = player.CharacterAdded
local Mouse = player:GetMouse()
local camera = game.Workspace.CurrentCamera

local defaultCframe = camera.CFrame
local view = 150
local blur = game.Lighting.Blur

blur.Size = 20

function updateCamera()
    camera.CFrame = game.Workspace.MenuCamera.CFrame
end

game:GetService("RunService").RenderStepped:Connect(updateCamera)

script.Parent.Framce.Play.MouseButton1Click:Connect(function()
    wait(0.2)
    blur.Size = 0
    camera.CameraType = Enum.CameraType.Custom
    script.Parent.Frame:Destroy()
end)

1 answer

Log in to vote
1
Answered by
appxritixn 2235 Moderation Voter Community Moderator
3 years ago

When asking a question, you should be more specific than "Something about not a valid member or something". Giving an error as general as that does not help anyone answer your question.

Luckily, I seem to have found an error in your code that would likely be giving an error along the lines of "X is not a valid member of Y".

On line 1, you have incorrect capitalization for LocalPlayer.

Change

local player = game.Players.LocalPLayer

to

local player = game.Players.LocalPlayer

Also, line 2 is assigning an event as your character. I think you meant to do this:

local character = player.Character or player.CharacterAdded:Wait()
0
Oops sorry. I was such in a rush I forgot to put the whole input in the description. TypicalVictorlks 17 — 3y
Ad

Answer this question