client script (local script)
local rs = game:GetService("ReplicatedStorage")
local Events = rs:WaitForChild("Events")
local TestingCommands = rs.Events:FindFirstChild("TestingCommands")
local function GetChosenPlayer()
local players = Players:GetPlayers()
if #players < 2 then
return nil
end
return players[math.random(1, #players)]
end
for i = 20, 0, -1 do
if #Players:GetPlayers() < 2 then return end
script.Parent.Text = i .. " till the game starts"
task.wait(1)
end
script.Parent.Text = "Starting..."
task.wait(2)
local chosenPlayer = nil
repeat
chosenPlayer = GetChosenPlayer()
task.wait(0.5)
until chosenPlayer ~= nil
if chosenPlayer then
print("Chosen player:", chosenPlayer.Name)
Events.GetRandomPlayerAndCreateCharacters:FireServer(chosenPlayer)
else
warn("Not enough players")
end```
server script (script)
```local rs = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local events = rs:WaitForChild("Events")
events.GetRandomPlayerAndCreateCharacters.OnServerEvent:Connect(function(yes,player)
print(player.UserId)
local rig = workspace:FindFirstChild("Manger1")
local humanoid = rig:FindFirstChild("Humanoid")
local description = Players:GetHumanoidDescriptionFromUserId(player.UserId)
humanoid:ApplyDescription(description)
rig.Name = player.Name
end)
apply desciption doesnt work and output says incorrect user id please help
** You are now Level 3! **