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

PlayerAdded for guis isnt workng?

local top = script.Parent.BlackBars.TopBar
local bottom = script.Parent.BlackBars.BottomBar
local info = script.Parent.BlackBars.Info
local date = script.Parent.BlackBars.Date

game.Players.PlayerAdded:Connect(function()
		wait(2.5)
	date.Visible = true
		wait(1.5)
	info.Visible = true
		wait(4.5)
	top:TweenPosition(UDim2.new(0,0, -0.379,0), "Out", "Quad", 3)
	bottom:TweenPosition(UDim2.new(0,0, -0.379,0), "Out", "Quad", 3)
end)

Basically, I'm trying to make a script that whenever a player joins, date will become visible, then info will be visible, then top and bottom will tween into position.

SCRIPT INFO: Type of script?: LocalScript Where is the script located?: StarterGui

1 comment

0

Try putting the player added event at the begging of the script.

2 answers

PlayerAdded doesn't work client-side. If you want to play a tween and all that when a player joins, just remove the playeradded and copy the gui into the players playergui when they join.

game.Players.PlayerAdded() Only works on Server scripts.

if you want to get the player from a localscript:

local player = game.Players.Localplayer

if you want to use a serverscript:

local Player

game.Players.PlayerAdded(function(player)
	Player  = player
end)

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