What do you want to achieve?
I want the player to touch a part that triggers a ScreenGUI and then after they trigger a proximity prompt in a different part, the ScreenGUI disappears.
I’ve created the script to make the ScreenGUI appear when touching the part… but then it disappears after the player isn’t touching it anymore & I don’t know how to make it disappear after the proximity prompt in a different part is triggered.
script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then local plr = game.Players:GetPlayerFromCharacter(hit.Parent) if plr then if not plr.PlayerGui:FindFirstChild("GUIClonedfromtouchblock") then local clonedgui = script.Parent:FindFirstChildOfClass("ScreenGui"):Clone() clonedgui.Name = "GUIClonedfromtouchblock" clonedgui.Parent = plr.PlayerGui script.Parent.TouchEnded:Connect(function(hit2) if hit == hit2 then game.Debris:AddItem(clonedgui,0) end end) end end end end)
I’d really appreciate some help