Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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()

1 comment

0

Oops sorry. I was such in a rush I forgot to put the whole input in the description.

This discussion is preserved as it was. New answers, comments, and votes are closed.