Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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!

3 comments

0

there is another way called premium benefits to increase the walkspeed, jump power, and maxhealth for premium players

0

Thats cool, I might implement that soon :)

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.

1 answer

Try this

local Humanoid = Player.Character.Humanoid

Humanoid.WalkSpeed += (Whatever you want)

2 comments

1

Hi! Thanks for the reply, but it says: attempt to index nil with 'Humanoid'

0

local Character = Player.Character or Player.CharacterAdded:Wait()

This discussion is preserved as it was. New answers, comments, and votes are closed.