I might be dumb but i cant figure out how to make my gui close?
Asked by
6 years ago Edited 6 years ago
Please include the code which you are trying to use, so the community will be better-equipped to help you with your problem.
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
01 | local Part = script.Parent |
05 | Part.Touched:connect( function (hit) |
06 | if hit and hit.Parent:FindFirstChild( "Humanoid" ) and DBounce then |
08 | local player = game.Players:GetPlayerFromCharacter(hit.Parent) |
09 | if player.PlayerGui:FindFirstChild( "Notice" ) then |
10 | player.PlayerGui.Notice.TextLabel.Visible = true |
12 | player.PlayerGui.Notice.TextLabel.Visible = false |