Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how to make this title show up then fades away on touch?

Asked by
22To 70
8 years ago

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

Log in to vote
0
Answered by 8 years ago
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)

Ad
Log in to vote
0
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
8 years ago

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
0
when i put in part it wont work nothing shows 22To 70 — 8y

Answer this question