how do i link the speed value in the leaderstat to the local player walkspeed
local dataStores = game:GetService("DataStoreService"):GetDataStore("Speed") local deafaultSpeed = 0 local playerLeft = 0 game.Players.PlayerAdded:Connect(function(player) local PlayerGui = player:WaitForChild('PlayerGui') playerLeft = playerLeft + 1 local leaderstats = Instance.new("Folder") leaderstats.Name = "leaderstats" leaderstats.Parent = player wait(1) local speed = Instance.new("IntValue") speed.Name = "Speed" speed.Value = game.StarterGui.ScreenGui.speed.Text speed.Parent = leaderstats
Try this out mate
function onChanged() player.Character:WaitForChild("Humanoid").WalkSpeed = speed end speed.Changed:Connect(onChanged)
The onChanged function sets the walkspeed to the speed value and the function fires every time speed has changed so it updates whenever you change the speed value. Hope this helps mate