I'm pretty new to scripting, and i'm wondering how to make the players speed equal to the leaderstats. I have made the leaderstat for the players speed and i have made it so it increases when a player uses the tool, but i'm lost on how i can the player's speed equal to the Speed leaderstat. Can anybody help?
In a local script you can do something like this (I am not able to check right now so there may be some bugs):
local Players = game:GetService("Players") local player = Players.LocalPlayer local character = workspace:WaitForChild(player.Name) local leaderstats = player.leaderstats local playerSpeed = leaderstats.speed function FunctionToBeCalled() character.Humanoid.WalkSpeed = playerSpeed end
Obviously as you have shown no code, I cant help you more specifically, but this is in general. I would recommend getting more familiar with roblox studio and its language before trying anything too advanced.
Closed as Not Constructive by JesseSong, EmbeddedHorror, Fifkee, Leamir, cailir, and User#29913
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?