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

Event won't trigger when a specific player joins?

Asked by
jetape 9
4 years ago

So I'm trying to create a script that'll trigger an event when a specific player (myself) joins the game. (I'm not the best at scripting, so this might look a little bit messy or unefficient.)

local line = script.Parent:WaitForChild('line')
local nova = script.Parent:WaitForChild('rise')
local init = script.Parent:WaitForChild('long')
local screen = script.Parent
local force = script.Parent.force


game.Players.PlayerAdded:Connect(function(player)
    if player.Name == 'jetape' then
        script.Parent.Frame.Visible = true
script.Parent.ImageLabel.Visible = true
game.Workspace.Sound.Playing = true
wait(6)
line:TweenSize(UDim2.new(0, 1054,0, 3), "Out", "Quad", 1)
line.Visible = true
wait(1.5)
nova.Visible = true
nova:TweenPosition(UDim2.new(0.318, 0,0.4, 0), "InOut", "Sine", 0.5)
wait(2)
init.Visible = true
wait(2)
nova.Text = 'test'
init.Text = 'test'
wait(6)
line:TweenSize(UDim2.new(0, 0,0, 0), "Out", "Quad", 1)
wait(0.6)
nova.Visible = false
init.Visible = false
wait(0.2)
line.Visible = false
wait(1.8)
game.Workspace.Sound.Playing = false
game.Workspace.Sound:Destroy()
screen.ImageLabel.Visible = false
screen.Frame.Visible = false
    else
    print('Failed')
      end
end)


As far as I know, this should be working. I don't receive any errors. Any help would be greatly appreciated.

0
It won't show for you, but it will show for other who joined before you. 9mze 193 — 4y
0
What script is this local or server sided? JesseSong 3916 — 4y
0
Do you want this to show for everyone? LennyPlayzYT 269 — 4y
0
I do want everything to show up for everyone, and it's a server script. jetape 9 — 4y

1 answer

Log in to vote
0
Answered by
imKirda 4491 Moderation Voter Community Moderator
4 years ago

If you put this script into Starter Gui then it won't work. I don't know where you have it but the script should be in Workspace, otherwise the function won't work. And Gui in Starter Gui (Of course change variables like: local line = game.StarterGui:WaitForChild"line").

0
You mean : game.StarterGui:WaitForChild("line") ? Why wouldn't it work in StarterGui ?  Nguyenlegiahung 1091 — 4y
0
It should be player gui. DesertusX 435 — 4y
0
With a few tweaks this worked, cheers. jetape 9 — 4y
Ad

Answer this question