--Server script rs = game:GetService("ReplicatedStorage") admins = {"LawlR", "gungirl60"} game.Players.PlayerAdded:Connect(function(plr) for _,a in pairs(admins) do if plr.Name == a then rs:FindFirstChild("adminjoined"):FireAllClients() end end end)
-
--Local script, ignore all of the function.. text1 = script.Parent.Parent.t1 text2 = script.Parent.Parent.t2 text3 = script.Parent.Parent.t3 text4 = script.Parent.Parent.t4 text5 = script.Parent.Parent.t5 text6 = script.Parent.Parent.t6 text7 = script.Parent.Parent.t7 rs = game:GetService("ReplicatedStorage") function adminjoined() script.Parent.Parent.Parent.Enabled = true repeat wait (.02) text1.TextTransparency = text1.TextTransparency + .03 until text1.TextTransparency >= 1 repeat wait (.02) text2.TextTransparency = text2.TextTransparency + .03 until text2.TextTransparency >= 1 repeat wait (.02) text3.TextTransparency = text3.TextTransparency + .03 until text3.TextTransparency >= 1 repeat wait (.02) text4.TextTransparency = text4.TextTransparency + .03 until text4.TextTransparency >= 1 repeat wait (.02) text5.TextTransparency = text5.TextTransparency + .03 until text5.TextTransparency >= 1 repeat wait (.02) text6.TextTransparency = text6.TextTransparency + .03 until text6.TextTransparency >= 1 repeat wait (.02) text7.TextTransparency = text7.TextTransparency + .03 until text7.TextTransparency >= 1 repeat wait (.02) text7.Parent.BackgroundTransparency = text7.Parent.BackgroundTransparency + .03 until text7.Parent.BackgroundTransparency >= 1 script.Parent.Parent.Parent.Enabled = false text1.TextTransparency = 0 text2.TextTransparency = 0 text3.TextTransparency = 0 text4.TextTransparency = 0 text5.TextTransparency = 0 text6.TextTransparency = 0 text7.TextTransparency = 0 end event = rs:WaitForChild("adminjoined") event.OnClientEvent:Connect(adminjoined)
How do I get the player's name that just joined? I would like to change the text to "(player that just joined) had joined" or something along those lines, but I'm not sure how to get the name.
If you want to give the player name to the clients, you can do the following:
ServerScript
rs:FindFirstChild("adminjoined"):FireAllClients(plr) --The plr variable has already been created
LocalScript
local function adminjoined(plr) --plr can be named anything --All the function things end event.OnClientEvent:Connect(adminjoined)
Hopefully this helps. If you have any problems please tell.
I am not sure what you mean. I will just give you 2 examples which may be what you want:
local plr = game.Players.LocalPlayer print(plr.. "has joined the game.")
or
game.Players.PlayerAdded:Connect(function(plr) print(plr.." has joined the game." end
If you wanna do this in client you may want to use the first examples.