Selecting random player issues

Tryna get the Creeps name so I can do stuff to it then do what I need with the rest of the players. Heres my current code cant figure this stuff out
printing the name wont work here

	local PAmount = game:GetService("Players"):GetPlayers()
		
		local creep = math.random(1,#PAmount)
		print(creep.Name)

i think you’re trying to get the number instead of the player
so instead

local PAmount = game:GetService("Players"):GetPlayers()
		
		local creep = PAmount[math.random(1,#PAmount)]
		print(creep.Name)
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.