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 this title show up then fades away on touch?

so im trying to make it that when they go to this area and touch the part a textlabel will show up saying the name then fades away but it wont work?

script.Parent.Touched:connect(function(hit)
if hit.Parent:findFirstChild("Humanoid") then
game.StarterGui.TextLabel.Text = "Welcome To Dockyard"
wait(6)
TextTransparency = 0.3
wait(1)
TextTransparency = 0.6
wait(1)
TextTransparency = 0.9
wait(1)
TextTransparency = 1

2 answers

✓ Accepted answer
local db = false

script.Parent.Touched:connect(function(hit)
    if not db then 
        db = true
        local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
        if plr then
            local gui = script.ScreenGui:clone()
	    gui.Parent = plr.PlayerGui
            gui.TextLabel.Text = 'Welcome To Dockyard'
            wait(6)
            gui.TextLabel.TextTransparency = .3
            wait(1)
            gui.TextLabel.TextTransparency = .6
            wait(1)
            gui.TextLabel.TextTransparency = .9
            wait(1)
            gui.TextLabel.TextTransparency = 1
	    gui:Remove()
        end
        db = false
    end
end)


I changed this to a popup gui by inserting the gui into the playergui (according to what you said)

Whenever a player joins the game, all the guis from StarterGui get replicated into their PlayerGui. You have to edit the gui inside their PlayerGui!

You should also add a Debounce

local db = false

script.Parent.Touched:connect(function(hit)
	if not db then 
		db = true
		local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
		if plr then
			local gui = plr.PlayerGui.TextLabel
			gui.Text = 'Welcome To Dockyard'
			wait(6)
			gui.TextTransparency = .3
			wait(1)
			gui.TextTransparency = .6
			wait(1)
			gui.TextTransparency = .9
			wait(1)
			gui.TextTransparency = 1
		end
		db = false
	end
end

1 comment

0

when i put in part it wont work nothing shows

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