Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What is wrong with this random player picker?

Asked by 5 years ago

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:

01while true do
02    local player = game:GetService("Players"
03    if workspace.TimeDifference.Value == 2 and script.SeekerPicked.Value == 0 then
04        local randomPlayer = game.Players:GetPlayers()
05        [math.random(1,#game.Players:GetPlayers())]
06    script.SeekerName.Value = randomPlayer.Name
07    print (script.SeekerName.Value)
08workspace[script.SeekerName.Value].Humanoid.WalkSpeed = 30
09    end
10    wait(0.01)
11end
0
At line 8 change SeekerName to randomPlayer JesseSong 3916 — 5y
0
thanks! kavancraft59 11 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

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

01while true do
02    local player = game:GetService("Players"
03    if workspace.TimeDifference.Value == 2 and script.SeekerPicked.Value == 0 then
04        local randomPlayer = game.Players:GetPlayers()
05        [math.random(1,#game.Players:GetPlayers())]
06    script.SeekerName.Value = randomPlayer.Name
07    print (script.SeekerName.Value)
08workspace[script.randomplayer.Value].Humanoid.WalkSpeed = 30
09    end
10    wait(0.01)
11end
Ad

Answer this question