I have tried to solve it on my own but it doesnt wanna work.
I have a ProximityPrompt and when you click E a UI opens.
It works perfectly fine the first time, but the second time it doesnt wanna work. It doesn’t make any sense.
Here is the code I have:
local armoredDiv = 0000
script.Parent.Triggered:Connect(function(plr)
if plr:IsInGroup(armoredDiv) or plr:GetRankInGroup(33488955) >= 50 then
print(plr.Name.." is pressing.")
plr.PlayerGui.TankSpawner.Frame.Visible = true
end
end)
And it literally prints “rasm123z is pressing” so it knows its my character, but for whatever reason it doesnt wanna show the frame the second time after closing it.
closing on local script is a way too close the gui.but server will not see its closed.server already opened it for you.but server still detects its opened.just copy and paste this:
local armoredDiv = 0000
script.Parent.Triggered:Connect(function(plr)
if plr:IsInGroup(armoredDiv) or plr:GetRankInGroup(33488955) >= 50 then
print(plr.Name.." is pressing.")
plr.PlayerGui.TankSpawner.Frame.Visible = false
plr.PlayerGui.TankSpawner.Frame.Visible = true
end
end)
Send a screenshot of the script that closes this UI.
also asking for clarification the code you sent is in a local script and the script that closes the UI is also a local script right?
This is probably because you are opening the UI on the server, and then closing it on the client via a local script. When you close the UI on client, the server still thinks the UI is visible. This means the server won’t make the UI visible again. To fix this, make the “close button” localscript a server script.
local armoredDiv = 0000
script.Parent.Triggered:Connect(function(plr)
if plr:IsInGroup(armoredDiv) or plr:GetRankInGroup(33488955) >= 50 then
print(plr.Name.." is pressing.")
plr.PlayerGui.TankSpawner.Frame.Visible = true
end
end)