Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My gui is not poping up for a second time on a ontouch event, help?

Asked by 4 years ago
Edited 4 years ago

So I have a script inside a block and when you touch it pops up a gui, there is a Gui in the block and its cloned and put it into your PlayerGui but when you close it, it deletes the screengui in your PlayerGui and the one in the brick is still there. But when I touch it again it does not work. it does not pop anything up. Help?



script.Parent.Touched:Connect(function(hit) local player = game.Players[hit.Parent.Name].PlayerGui if not player:FindFirstChild("Box") then local d = script.Parent.Box:Clone() d.Parent = player end end)
1
How is the GUI deleted? If it's deleted on the client, then it wouldn't replicate that to the server, causing the server to think that the GUI is still there when it's not there on the client. y3_th 176 — 4y
0
This is generally the wrong way to do it. Use Remotes. Asceylos 562 — 4y
0
Thanks for the comments i'll try that with remotes. JiveMaster -5 — 4y

Answer this question