hey there, i have turned to scripting helpers NOT for a request but a start/Explanantion on why my script will NOT delete my gui?
i have an on touched event triggered when a player touches the part but the gui will not remove itself after a said amount of time, its frustrating because i also cannot find any help on google, they only help with touched event with a gui you manually close with Mouse Click, i'll explain a little more...
my part is in the workspace spawned in via debris, then when a player touches it, it counts as a point toward money, which works perfectly in server and client mode. but i want there to be a gui popup that says "you picked up...." simply because the player doesnt need to press F like they need to for my NPCs, so they wont exactly know they picked up anything. my GUI appears on screen when touched, but i can't find a way to DELETE it or make it INVISIBLE after say... 3 seconds.
i have tried to have the gui deleted after 3 seconds but when i enter the game it deletes in all my debris after 3 seconds before i pick it up, my issue being i really cant find a local player, to delete it so it deletes itself after 3 seconds in the Debris, instead of player GUI, i feel dumb like this is very easy but i am missing something. is this a local script?
any help would be appreciated.
EDIT: this is the code: sorry if it is a mess lol i am a little lost
local Part = script.Parent
local DBounce = true
Part.Touched:connect(function(hit)
if hit and hit.Parent:FindFirstChild("Humanoid") and DBounce then
DBounce = false
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player.PlayerGui:FindFirstChild("Notice") then
player.PlayerGui.Notice.TextLabel.Visible = true
wait(3)
player.PlayerGui.Notice.TextLabel.Visible = false
end
wait()
DBounce = true
end
end)

4 comments
Could you show us the script you had for this? It'd be much help for us to solve your issue.
yes, please provide the code
i posted it
you should change screen gui elements from the client