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

Selecting a player?

In a game I'm creating I need to know the basics to selecting a player to attack. Like survival 303, when you click on a player, with your sword it damages them. What part in there, and make it so an animation will play, showing the player swinging their sword, yet the player has damaged the target?

1 answer

wait(2) --Bugs if you don't wait

local players = game.Players:GetPlayers()
local randomplayer = players[math.random(1, #players)]
print(randomplayer.Name)

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