Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How To Make Screen GUI Appear When Touching Object And Then Disappear After 2.5 Seconds?

So Basically I Want My Screen GUI To Disappear After The Wait Time. It Works Only Once Then Stops. I Am Not Sure How To Fix This. Here Is My Current Script RN.

local db = false

script.Parent.Touched:Connect(function(hit)
	if not db then
		db = true
		local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
		local h = hit.Parent:FindFirstChild("Humanoid")
		if plr and h then
			if plr.leaderstats.Endurance.Value < 250 then
				script.AcidGui:Clone().Parent = plr.PlayerGui 
				wait(2.5)
				plr.PlayerGui.AcidGui.Enabled = false
			end
		end
		wait(2.5)
		db = false		
	end
end)

1 answer

✓ Accepted answer

You need to Local the clone of AcidGui, because in Line 12 you are referring to the original "AcidGui" and not the cloned one Try something like this, ON LINE 10:

Local ClonedAcidGui = script.AcidGui:Clone()
ClonedAcidGui.Parent = plr.PlayerGui
wait(2.5)
ClonedAcidGui:Remove()

2 comments

0

I just edited it, copy it again

0

I Really Appreciate It, This Took Me Nearly 10 Hours To Do. And Your Answer Was The Only Correct One I Could Find

This discussion is preserved as it was. New answers, comments, and votes are closed.