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

Can't give a player speed depending on a value; player loading inconsistent?

Asked by 3 years ago

Hi, I hope you are doing well.

I am trying to give a player speed depending on their "SpeedLevel," an int value found in a folder in the player. The problem is that the player doesn't gain any speed.

In this script, I try waiting 5 seconds to make sure the player is fully loaded but their walkspeed doesn't change. No error comes out.

This is in a regular script found under ServerScriptService.

game.Players.PlayerAdded:Connect(function(player)
    wait(5)
    local SpeedLevel = player.InfoFolder.SpeedLevel
    local WalkSpeed = player.Character.Humanoid.WalkSpeed

    WalkSpeed = WalkSpeed + (SpeedLevel.Value*3)
end)

Hopefully I have been clear, let me know if you need more info. Thanks!

0
there is another way called premium benefits to increase the walkspeed, jump power, and maxhealth for premium players extrorobo 104 — 3y
0
Thats cool, I might implement that soon :) DoudGeorges 38 — 3y
0
Except at the moment I want to do it so that players get 3 more speed per level, which I can't seem to do. DoudGeorges 38 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

Try this

local Humanoid = Player.Character.Humanoid

Humanoid.WalkSpeed += (Whatever you want)
1
Hi! Thanks for the reply, but it says: attempt to index nil with 'Humanoid' DoudGeorges 38 — 3y
0
local Character = Player.Character or Player.CharacterAdded:Wait() wurldburd 86 — 3y
Ad

Answer this question