Hello I am creating a admin panel with a speed command that is controlled by two textboxes. One textbox is for the player's name while the other is for the number that the speed of the player with be set to. Only the the player textbox works and I cannot figure out why the other one doesn't work, as it throws up a nil value, as if nothing was ever typed there even if something was typed. If anyone knows a way to fix the script down below so the second textbox does not do this, please reply with one as soon as possible.
local player
for i, v in pairs(game.Players:GetChildren()) do
if string.lower(v.Name):sub(1, #plrtospeedup) == string.lower(plrtospeedup) or string.lower(v.DisplayName):sub(1, #plrtospeedup) == string.lower(plrtospeedup) then
player = v
break
end
end
if player then
if player.Character then
player.Character.Humanoid.WalkSpeed = tonumber(script.Parent.Parent.Parent.Parent.nonplrargs.Text)
end
end
end)```
** You are now Level 8! **