Hello, im developing a speed simulator game and struggling on this bug. So, basically:
- I have a leaderstats value which sets Players walkspeed in server script.
- When I try to reset my character, walkspeed goes back to default and player cant increase speed anymore.
Players.PlayerAdded:Connect(function(Player)
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild('Humanoid')
local isMoving = false
local FreakinessAmount = 0.01
Humanoid.WalkSpeed = 0 -- Starting speed
Humanoid.Changed:Connect(function(Property)
if Property == "MoveDirection" then
if Humanoid.MoveDirection == Vector3.zero then
isMoving = false
else
isMoving = true
end
end
end)
local Leaderstats = Player:WaitForChild('leaderstats')
local Freakiness = Leaderstats.Freakiness
repeat
if isMoving then
Freakiness.Value += (FreakinessAmount * FreakinessMultiplier)
Humanoid.WalkSpeed = Freakiness.Value
end
wait(.1)
until false
Player.Character:WaitForChild('Humanoid').Died:Connect(function()
SpeedBeforeDeath = Humanoid.WalkSpeed
end)
Player.CharacterAdded:Connect(function(character)
character:WaitForChild("Humanoid").WalkSpeed = SpeedBeforeDeath
end)
end)
**Also this warning fiers if i reset: ** RunService:UnbindFromRenderStep removed different functions with same reference name utility-focus-state-inspect-abkolia228 2 times.