I’m trying to make a GUI button function script, but for some reason it isn’t working and there aren’t any errors in the Output, nor any Print messages. Do any of you know what’s going on? I was doing WaitForChild on that “local BtoolsButton” thing, but the problem happened so I removed the WaitForChild and it still didn’t get fixed, all while there were no errors in the Output.
The btoolsbutton references the startergui, whereas it needs to reference the player gui.
If it’s a local script:
local player = game:GetService("Players").LocalPlayer
player.PlayerGui....restofpathtobutton
Just put the script in the button to avoid such problems.
This is the script (It’s not a local script), I didn’t include that Player function in the previous image because I thought it wasn’t necessary to show.
It still needs to reference the playergui though.
You already have the player ref from the player added connection so just change where it says ‘game.startergui’ to ‘player.PlayerGui’
Edit: the GUI may not have loaded by this point so you may need to wait for child, or add the connection when the character loads.
Yes, this would make some things simpler, but others more difficult… Depends really on how it fits with the rest of your code.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.