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

Not a valid member of the local script?

So I am having an issue where the code I have isnt a valid member of the local script, but I dont know how to fix it, Please help.

Eletrin

local OptionButton = game.ReplicatedFirst.MainScreenScript.StartButtons.Frame.OptionButton
	local StoreButton = game.ReplicatedFirst.MainScreenScript.StartButtons.Frame.StoreButton

4 comments

0

this is all script??

0

maybe StartButtons isnt child of MainScreenScript, maybe you misspelled something

0

This isnt all the code but if you need more I can provide it

0

Send all ill check

1 answer

----------------------------------------------------------------------
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local CameraMenu = workspace.CurrentCamera
----------------------------------------------------------------------
game.ReplicatedFirst:RemoveDefaultLoadingScreen()

local PlayerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
PlayerGui:SetTopbarTransparency(0)

local GUI = script.LoadingScreen:Clone()
GUI.Parent = PlayerGui

wait(5)

repeat wait(1) until game:IsLoaded()

GUI.Frame:TweenPosition(UDim2.new(0,0,1,0),"InOut","Sine",0.5)
wait(0.5)
GUI:Destroy()

--------------------------------------------------------------------
local Screen = game.ReplicatedFirst.MainScreenScript.BataWarning.Frame
local PlayButton = Screen.ContinueButton

local PlayerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
PlayerGui:SetTopbarTransparency(0)

local GUI = script.BataWarning
GUI.Parent = PlayerGui

GUI.Frame:TweenPosition(UDim2.new(0.363, 0,0.341, 0),"InOut","Sine",0.5)
wait(0.5)

PlayButton.Activated:Connect(function()
	GUI.Frame:TweenPosition(UDim2.new(0.363,0,1,0),"InOut","Sine",0.5)
	wait(1)

	local Screen2 = game.ReplicatedFirst.MainScreenScript.MenuText.Frame

	local PlayerGui2 = game.Players.LocalPlayer:WaitForChild("PlayerGui")
	PlayerGui2:SetTopbarTransparency(0)

	local GUI2 = script.MenuText
	GUI2.Parent = PlayerGui

	GUI2.Frame:TweenPosition(UDim2.new(0.29,0,0.042,0),"InOut","Sine",2)
	wait(1)
	
	local Screen3 = game.ReplicatedFirst.MainScreenScript.StartButtons.Frame
	local StartButton3 = Screen3.StartButton

	local PlayerGui3 = game.Players.LocalPlayer:WaitForChild("PlayerGui")
	PlayerGui3:SetTopbarTransparency(0)

	local GUI3 = script.StartButtons
	GUI3.Parent = PlayerGui

	GUI3.Frame:TweenPosition(UDim2.new(0.022,0,0.843,0),"InOut","Sine",1.1)
	wait(1)

	local Screen5 = game.ReplicatedFirst.MainScreenScript.Options.Frame
	local OptionButton = game.ReplicatedFirst.MainScreenScript.StartButtons.Frame.OptionButton --- This line is the error 

	local PlayerGui5 = game.Players.LocalPlayer:WaitForChild("PlayerGui")
	PlayerGui5:SetTopbarTransparency(0)

	local GUI5 = script.Options
	GUI5.Parent = PlayerGui

	OptionButton.Activated:Connect(function()
		GUI5.Frame:TweenPosition(UDim2.new(0.354,0,0.361,0),"InOut","Sine",0.5)
		wait(0.5)
	end)
	 
	StartButton3.Activated:Connect(function()
		GUI3.Frame:TweenPosition(UDim2.new(0.022,0,1,0),"InOut","Sine",1.1)
		GUI2.Frame:TweenPosition(UDim2.new(0.29,0,-0.85,0),"InOut","Sine",2)
		
		local Screen4 = game.ReplicatedFirst.MainScreenScript.StartScene.Frame

		local PlayerGui4 = game.Players.LocalPlayer:WaitForChild("PlayerGui")
		PlayerGui4:SetTopbarTransparency(0)

		local GUI4 = script.StartScene
		GUI4.Parent = PlayerGui

		GUI4.Frame:TweenPosition(UDim2.new(0,0,0,0),"InOut","Sine",0.5)
		wait(3)
		
		GUI5.Frame:TweenPosition(UDim2.new(0.387,0,1,0),"InOut","Sine",0.5)
		wait(1)
		
		--GUI6.Frame:TweenPosition(UDim2.new(0.371,0,1,0),"InOut","Sine",0.5)
		--wait(1)
	
		CameraMenu.CameraType = Enum.CameraType.Custom
		wait(1)
		
		repeat wait(1) until game:IsLoaded()

		GUI4.Frame:TweenPosition(UDim2.new(0,0,1,0),"InOut","Sine",0.5)
		wait(0.5)		
	end)
end)
--------------------------------------------------------------------

1 comment

0

Line 63 is the issue

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