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

frame is not a valid member of frame?

Asked by 4 years ago
Edited 4 years ago

im making a camping game and im working on a exit car button but when I click on it it says this frame is not a valid member of frame here are the 2 local scripts I use

local frame = script.Parent.Parent.frame local open = false

script.Parent.MouseButton1Click:Connect(function() if frame.Visible == false then frame.Visible = true else frame.Visible = false end end)

local character = game.Players.LocalPlayer.CharacterAdded:Wait() script.Parent.MouseButton1Click:Connect(function() if character:FindFirstChild("HumanoidRootPart") then
character.HumanoidRootPart.CFrame = CFrame.new(workspace.respawn.position) end end)

PS here screenshots https://imgur.com/KokOEwe https://imgur.com/G68Hgo2

0
Use a code block JesseSong 3916 — 4y

1 answer

Log in to vote
1
Answered by
Mayk728 855 Moderation Voter
4 years ago
Edited 4 years ago

Based on the first screenshot, you are looking for a Frame inside of the Frame (literally what the error is telling you) when there isn't one.

On line 1 in the first script, replace script.Parent.Parent.Frame with script.Parent.Parent

Also, to make it easier for people to read your script, make sure to highlight the text and press the blue Lua button to add a code block, so it will turn the text into a script.

1
thx topsporter2007 -4 — 4y
Ad

Answer this question