#Access PlayerScripts through StarterGui

79 messages · Page 1 of 1 (latest)

wild night
#

could you take a screenshot of the script if that's okay

#

it'll be easier to help you with your problem

wintry idol
#

yup

#

sure

#

There, all the info you need

#

hopefully

quaint ferry
#

send the full script please

#

@wintry idol

wintry idol
#
local gui = script.Parent.Parent
local detector = gui.Text1Frame.Text1

local plr = game.Players

detector.MouseButton1Click:Connect(function(player)
    local leverPlayed = player.PlayerScripts:WaitForChild("leverPlayed")
    local neutralizerPlayed = player.PlayerScripts:WaitForChild("neutralizerPlayed")
    local bothPlayed = player.PlayerScripts:WaitForChild("bothPlayed")
end)

if leverPlayed.Value == false and neutralizerPlayed.Value == false and bothPlayed.Value == false then
    gui.Text3Frame.Visible = true
    gui.Text2Frame.Visible = false
end
#

sry I went to have dinner

wild night
#

are you trying to access StarterPlayerScripts

wintry idol
#

no

wintry idol
# wintry idol

I need to access the BoolValue (from the Explorer in this picture) in each players

wild night
#

im not sure if it's possible to access starterplayerscripts or not

#

but im sure that'll fix your problem of not being able to access the boolean values

wintry idol
#

Doesn't work either :/

wild night
wintry idol
#

yes

#

Wait actually

#

Let me find a tutorial system video first

#

So maybe I can follow that video

#

brb

wild night
#

local gui = script.Parent.Parent
local detector = gui.Text1Frame.Text1

local plr = game.Players.LocalPlayer

detector.MouseButton1Click:Connect(function(player)
local leverPlayed = player.PlayerGui:WaitForChild("leverPlayed")
local neutralizerPlayed = PlayerGui.PlayerScripts:WaitForChild("neutralizerPlayed")
local bothPlayed = player.PlayerGui:WaitForChild("bothPlayed")
end)

if leverPlayed.Value == false and neutralizerPlayed.Value == false and bothPlayed.Value == false then
gui.Text3Frame.Visible = true
gui.Text2Frame.Visible = false
end

#

this should fix your problem

#

remember to put the boolean values in startergui

#

and everything should work

steady geyser
wintry idol
#

yeah I did that

steady geyser
#
local gui = script.Parent.Parent
local detector = gui.Text1Frame.Text1

local plr = game.Players.LocalPlayer

detector.MouseButton1Click:Connect(function(player)
    local leverPlayed = player.PlayerGui:WaitForChild("leverPlayed")
    local neutralizerPlayed = PlayerGui.PlayerScripts:WaitForChild("neutralizerPlayed")
    local bothPlayed = player.PlayerGui:WaitForChild("bothPlayed")
end)

if leverPlayed.Value == false and neutralizerPlayed.Value == false and bothPlayed.Value == false then
    gui.Text3Frame.Visible = true
    gui.Text2Frame.Visible = false
end
#

i meant that for john

wintry idol
#

ok

steady geyser
#

@wild night

wild night
#

yeah it should work

wild night
#

i didn't know that

wintry idol
#

yeah no it doesn't :(

steady geyser
wild night
steady geyser
wild night
#

and then send the error

steady geyser
#

it should say which line is causing the issue

wintry idol
#

Uh

#
local leverPlayed = player.PlayerGui:WaitForChild("leverPlayed")
    local neutralizerPlayed = PlayerGui.PlayerScripts:WaitForChild("neutralizerPlayed")
    local bothPlayed = player.PlayerGui:WaitForChild("bothPlayed")
#

These lines

#

Cuz

#

It said

#

DialogueChangeHandler attempted to index nil with 'PlayerGui'

wintry idol
wild night
#

ok wait don't move it yet

#

send the screenshot of the code now

wintry idol
#
local gui = script.Parent.Parent
local detector = gui.Text1Frame.Text1

local plr = game.Players.LocalPlayer

detector.MouseButton1Click:Connect(function(player)
    local leverPlayed = player.PlayerGui:WaitForChild("leverPlayed")
    local neutralizerPlayed = PlayerGui.PlayerScripts:WaitForChild("neutralizerPlayed")
    local bothPlayed = player.PlayerGui:WaitForChild("bothPlayed")
end)

if leverPlayed.Value == false and neutralizerPlayed.Value == false and bothPlayed.Value == false then
    gui.Text3Frame.Visible = true
    gui.Text2Frame.Visible = false
end
#

I gotta rotate to bed now so I'll come back tmr

#

cya

wild night
#

alright

visual marsh
wild night
#
local gui = script.Parent.Parent
local detector = gui.Text1Frame.Text1

local plr = game.Players.LocalPlayer

detector.MouseButton1Click:Connect(function(player)
    local leverPlayed = player.PlayerGui:WaitForChild("leverPlayed")
    local neutralizerPlayed = player.PlayerGui:WaitForChild("neutralizerPlayed")
    local bothPlayed = player.PlayerGui:WaitForChild("bothPlayed")
end)

if leverPlayed.Value == false and neutralizerPlayed.Value == false and bothPlayed.Value == false then
    gui.Text3Frame.Visible = true
    gui.Text2Frame.Visible = false
end
#

this should make it work

#

if you want to change it back to playerscripts do

#
local gui = script.Parent.Parent
local detector = gui.Text1Frame.Text1

local plr = game.Players.LocalPlayer

detector.MouseButton1Click:Connect(function(player)
    local leverPlayed = player.PlayerScripts:WaitForChild("leverPlayed")
    local neutralizerPlayed = player.PlayerScripts.PlayerGui:WaitForChild("neutralizerPlayed")
    local bothPlayed = player.PlayerScripts:WaitForChild("bothPlayed")
end)

if leverPlayed.Value == false and neutralizerPlayed.Value == false and bothPlayed.Value == false then
    gui.Text3Frame.Visible = true
    gui.Text2Frame.Visible = false
end
#

i also realized the reason it didn't work in the first place was because you didn't reference the localplayer

#

so a single line would've fixed this problem from the start

#

mb anyways

visual marsh
wild night
#

didn't see that at all tyyy

quaint ferry
#

bruh I said that

#

but i deleted it cause the script looked to messy

wintry idol
#

Ok

#

So

#

There’s absolutely no use for the plr

#

The only thing I used is player which is an argument in the MouseButton1Click thing

visual marsh
wintry idol
#

Yeah I realized

#

I created leverPlayed and others locally in the click function

#

So I can’t call them in the if statement