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

What is wrong with this random player picker?

Can somebody please help me? I have this script here where it picks a random player and selects them to be the seeker. However, I don't know if it's the random player picker or the script that makes them walk faster, but all of the players are getting faster walking speeds. Can somebody please check it over and tell me what's wrong? Thanks!

Here is the script:

while true do
	local player = game:GetService("Players")  
	if workspace.TimeDifference.Value == 2 and script.SeekerPicked.Value == 0 then
		local randomPlayer = game.Players:GetPlayers()
		[math.random(1,#game.Players:GetPlayers())]
	script.SeekerName.Value	= randomPlayer.Name
	print (script.SeekerName.Value)
workspace[script.SeekerName.Value].Humanoid.WalkSpeed = 30
	end
	wait(0.01)
end

2 comments

0

At line 8 change SeekerName to randomPlayer

0

thanks!

1 answer

✓ Accepted answer

JesseSong made this i put it here so you can see it better

while true do
    local player = game:GetService("Players")  
    if workspace.TimeDifference.Value == 2 and script.SeekerPicked.Value == 0 then
        local randomPlayer = game.Players:GetPlayers()
        [math.random(1,#game.Players:GetPlayers())]
    script.SeekerName.Value = randomPlayer.Name
    print (script.SeekerName.Value)
workspace[script.randomplayer.Value].Humanoid.WalkSpeed = 30
    end
    wait(0.01)
end

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