roblox lua on player join code example
Example 1: roblox playeradded
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
print(player.Name .. " joined the game!")
end)
Players.PlayerRemoving:Connect(function(player)
print(player.Name .. " left the game!")
end)
Example 2: roblox lua on player chatted
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg)
-- do stuff with msg and player
end)
end)