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

Why wont the GUI respond to boolean value change? No Errors.

Still having the same problem as yesterday, the GUI wont change along the boolean value.

Here is an image of everything.

https://imgur.com/a/EqjnGgf

local MenuOver = script.Parent:FindFirstChild("MenuOver")
MenuOver.Value = false
print(MenuOver.Value) -- This prints properly

First of all, the value of menu over prints properly like its supposed to.

After this part is some other code for the menu, but that isnt important.

Here is the second part of the script

PlayBtn.MouseButton1Click:Connect(function()
	MenuOver.Value = true
	SlideInSide:Play()
	print("Menu Over is", MenuOver.Value) -- Everything in this function is properly printed.
	TutorialPopout:Play()

end)

It also prints properly here as well.

Now here is the second script:


local HUDPlayer = script.Parent.HUDPlayer
local Tween = game:GetService("TweenService")
local MenuOver = game.StarterGui.Menu.MenuOver
local HudPlayerSlidein = Tween:Create(HUDPlayer, TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Position = UDim2.new(0.6, 0, 2, 0)})

MenuOver:GetPropertyChangedSignal("Value"):Connect(function(newValue)
    HudPlayerSlidein:Play()
    print("Worked!")
	wait()
end)

Not sure why, but it doesnt do anything inside of the function, it checks

2 comments

0

Can you give me some more information on what you are trying to achieve? I dont understand what it is your are doing; therefore, I cannot help you.

0

Accept my answer :eyes:

1 answer

✓ Accepted answer

Simple fix for you, in the bottom script line 3, you're accessing the StarterGui, NOT the PlayerGui! Most common mistake with people learning to script on Roblox. It should be

local MenuOver = game.Players.LocalPlayer:WaitForChild('PlayerGui').Menu.MenuOver -- Good habit to use WaitForChild on the client

The StarterGui is what the game uses to put all of the UI's into a Player's PlayerGui.

1 comment

0

It worked! Thank you!

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