Scripting Help On My Speed Simulator Game

I want to achieve a speed simulator game that has a script within it that every time you walk, you get your speed increased & also your Stats Leaderboard statistic. The issue is that I cannot find any workshop scripts that have this that also work & I have even gone as far as roblox tutorials on youtube on how to do this and none of them work like my old script. I have looked for solutions on devforum & have tried recovering my old speed increase script but I cannot find it. Any youtube videos or models that may work please send them in the comments, im not looking for handwritten scripts but I cannot find any working scripts like this maybe some of you scriptors know a popular scripter/youtuber who has one avaliable for free?

3 Likes

Just hook a function to the Humanoid.Running event which updates the players speed

Honestly I have no idea how to script beyond youtube tutorials.

Well that’s your problem you rely on tutorials, you have to learn all the syntax of lua then you need to practice

I suggest watching this whole playlist then you can begin practicing How To Script On Roblox 2023 - Episode 1 (Printing) - YouTube

Well, in that case you ought to get basic scripting knowledge before starting to create smth as huge as a simulator. Also don’t follow along tutorials for making scripts; it will just make you overdependent on them. Anyways for educational purposes, I will provide a working script for you and since I’m feeling extra nice, every part will be commented.

local Players = game:GetService("Players")

local speedIncrement = 1 --// The amount by which the walkspeed will be incremented, better to keep it low

Players.PlayerAdded:Connect(function(player) --// Listen for when a player joins the server
    local character = player.Character or player.CharacterAdded:Wait() --// Get player's character if there is one, otherwise wait for the CharacterAdded event which fires when a new character is added along with the character instance
    local humanoid = charcater:WaitForChild("Humanoid") --// Get humanoid
    humanoid.Running:Connect(function() --// Hook a function to the Running event of humanoid which runs whenever the player is moving
        humanoid.Walkspeed += speedIncrement --// Increment the player's walkspeed by a said amount
    end)
end)
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.