Hi!
I made a script that change a Frame Visible to true when player trigger a ProximityPrompt, but it’s work only one time, this is my script:
local isOpened = false -- Debounce
local Proximity = script.Parent
Proximity.Triggered:Connect(function(player)
if isOpened == false then
player.PlayerGui.JarroShop.Hand.Visible = true -- GUI Frame
isOpened = true
elseif isOpened == true then
player.PlayerGui.JarroShop.Hand.Visible = true -- GUI Frame
isOpened = false
end
end)
Thanks
So make it
local isOpened = false -- Debounce
local Proximity = script.Parent
Proximity.Triggered:Connect(function(player)
if isOpened == false then
player.PlayerGui.JarroShop.Hand.Visible = true -- GUI Frame
isOpened = true
elseif isOpened == true then
player.PlayerGui.JarroShop.Hand.Visible = false -- GUI Frame
isOpened = false
end
end)
Let me know if it didnt work.
but I want to make a script that always Change visible to true, because in this GUI I have a script that close this frame (Close means Change Visible to false)
IBuildXP
(SoupIsGoodFood)
July 29, 2021, 2:22pm
#5
I think you have to defy the playergui like this:
game:GetService(‘Players’).LocalPlayer:WaitForChild(‘PlayerGui’)
MrRBX_Dev:
it’s work only one time
I said this gui shows only first time when player trigger a ProximityPrompt
Rami_XD1
(RamiDeV)
July 29, 2021, 2:45pm
#7
Make sure the script is localscript
and its place in the startergui
Rami_XD1
(RamiDeV)
July 29, 2021, 2:54pm
#8
or Try this
local Proximity = script.Parent
Proximity.Triggered:Connect(function(player)
local Hand = player.PlayerGui:FindFirstChild("JarroShop"):FindFirstChild("Hand")
if Hand then
Hand.Visible = not Hand.Visible
end
end)
1 Like