Hi, then is for some reason underlined in my script what am I doing wrong and how could I fix this?? I just started scripting with Lua and I am still learning it so it could be an easy fix. Code:
script.Parent.ProximityPrompt.Triggered:Connect(function(plr) plr.PlayerGui.TPGUI.Enabled = false if not then plr.PlayerGui.TPGUI.Enabled = true end end)
What the script is supposed to do is when a player clicks the proximity prompt it will check if the gui which is named TPGUI is disabled if it is it would enable it
Any help would be extraordinary
--Thanks Theking66hayday
You have to first check if the GUI is enabled using an if statement. To use the if statement, it goes like this:
script.Parent.ProximityPrompt.Triggered:Connect(function(plr) if plr.PlayerGui.TPGUI.Enabled == false then plr.PlayerGui.TPGUI.Enabled = true end end)
The if statement checks if the gui is enabled, if it is not enabled, the GUI is enabled.
im not sure if this works, but try this:
script.Parent.ProximityPrompt.Triggered:Connect(function(plr) local Debounce = false plr.PlayerGui.TPGUI.Enabled = false if Debounce ==true then plr.PlayerGui.TPGUI.Enabled = true end end)