Hi! I need help with this, when I triggered ProximyPromt the first time then the second time nothing happened. I tried searching on Roblox DevForum but I didn’t find anything.
script.Parent.Triggered:Connect(function(player)
player.PlayerGui.Research.Enabled = true
end)
1 Like
Dfn150
(DevFunNewIdeas)
August 9, 2022, 5:55pm
#2
Well, you’re only enabling it once and that’s it. You should use a debounce:
local debounce = false
script.Parent.Triggered:Connect(function(player)
if player.PlayerGui.Research.Enabled ~= true then
debounce = true
player.PlayerGui.Research.Enabled = true
wait()
player.PlayerGui.Research.Enabled = false
debounce = false
end
end)
EDIT: I changed it to where it will change if it is enabled when the debounce = false
1 Like
msix29
(msix29)
August 9, 2022, 6:03pm
#3
There will be no difference if you used it multiple times…
It does fire multiple times tho, you can check by adding a print
1 Like
Dfn150
(DevFunNewIdeas)
August 9, 2022, 6:06pm
#4
That’s why he should use my script
1 Like
msix29
(msix29)
August 9, 2022, 6:08pm
#5
It still wont make any difference firing it multiple times wont make any change it will run the same way, your code just checks if its enabled or not…
1 Like
Alsoenum
(Zeroenum)
August 9, 2022, 6:25pm
#6
Try this
script.Parent.Triggered:Connect(function(player)
print('Triggered')
player.PlayerGui.Research.Enabled = not player.PlayerGui.Research.Enabled
end)
1 Like
Today I realized The Script will turn on GUI and LOCALSCRIPT will close. After I close GUI from LOCALSCIPRT I dont see it on but Server still thinks I see GUI. I need use RemoteEvent.
1 Like