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 4 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:

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

0
At line 8 change SeekerName to randomPlayer JesseSong 3916 — 4y
0
thanks! kavancraft59 11 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

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

Ad

Answer this question