Can somebody please help me? I'm making a hide and seek game where a random player is selected as seeker and they have a higher walking speed. However, I don't know how to find that player in the workspace. I am fairly new to Roblox scripting and can someone help me out. 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

6 comments
Thanks but it says that "randomPlayer is not a valid member of Players." Anyway to fix that? Thanks!
Whoops! Sorry, I edited the script and it should work now.
don't worry if you can't help with this, but if you can, what does "attempt to index nil with WalkSpeed" mean? Thanks!
I edited the script again. I'm not sure if this would work, but just try it anyways.
It says the same thing? I will try and figure out why. Thanks for your help though!
No problem! Since I helped, could you please accept my answer?