I only want my gui to show when the part is being touched, right now it is staying on the screen until you X out of it. This is what I have using a remote event(probably wrong thing to use)
local limit = 2
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player.leaderstats.Points.Value >= limit then
if hit.Parent:FindFirstChild("Torso") then
script.Parent.CanCollide = false
elseif hit.Parent:FindFirstChild("UpperTorso") then
script.Parent.CanCollide = false
end
end
end
end)
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid")then
game.ReplicatedStorage.Popup:FireClient(game.Players:GetPlayerFromCharacter(hit.Parent))
end
end)

6 comments
u s e c o d e b l o c k s f o r y o u r e n t i r e s c r i p t
ok i dont get it when do you want it to pop up? because its like its not popping up at all? what's your problem xd
it pops up when a part is touched but I only want it to show when the part is being touched, right now it stays after you stop touching the part
Why are you even using :FireClient()? The player GUI can be accessible by doing game.Players:GetPlayerFromCharacter(hit.Parent). Bruh
im new to scripting
if you want it to pop up when touched, do script.Parent.Touched, and when you want it to go away, use script.Parent.TouchEnded.