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

Why isn't my if statement working when I set it to true?[closed]

Asked by 3 years ago
Edited 3 years ago

It works when I set it to false but when I set it to true it doesn't work. No studio errors in output because technically there are none.

if game.StarterGui.Shop.Frame.Visible == true then
    script.Parent.Buy.Disabled = false
    print("something for testing")
end
--doesn't work
if game.StarterGui.Shop.Frame.Visible == false then
    script.Parent.Buy.Disabled = false
    print("something")
end
--works
0
cuz ur using startergui NERD and it replicates to the players, just use script.Parents instead of game.StarterGui greatneil80 2647 — 3y
0
k techingenius -82 — 3y
0
and no need to be rude techingenius -82 — 3y
0
also ur the idiot here it doesn't even work techingenius -82 — 3y
View all comments (3 more)
0
I think its because both do the exact thing.. DevvUnknown 3 — 3y
0
Okay, I don't think you understand me, there is a game.StarterGui, then there is a player.PlayerGui, if you change the game.StarterGui, it isn't the player.PlayerGui and the player won't see it. instead of using game.StarterGui, use script.Parents, make sure its a local script greatneil80 2647 — 3y
0
Yeah I changed it to script.Parent and I used a local script techingenius -82 — 3y

Answer this question