Hello, I have problem with my walkspeed script when player join to game. So in my place i have something like a "speed shop", when player join to game script set his walkspeed on 25, but if player buy +30 walkspeed in speed shop it works only for a few seconds and set back 25 walkspeed... Here is walkspeed script:
function edit(h)
if h ~= nil then
h.WalkSpeed = 25
end
end
while true do
cur = game.Players:GetChildren()
for i = 1, #cur do
edit(cur[i].Character.Humanoid)
wait(0.1)
end
wait(4)
end
Here is script from shop, maybe someone will need it too:
local dialog = script.Parent
function answer(player, pick)
local char = player.Character
local humanoid = char["Humanoid"]
local stats = player:findFirstChild("leaderstats")
local g = stats:findFirstChild("Points")
if pick.Name == "30" then
if g.Value >= 500 then
humanoid.WalkSpeed = humanoid.WalkSpeed + 30
g.Value = g.Value - 500
end
end
end
dialog.DialogChoiceSelected:connect(answer)
It's dialog shop.

1 comment
Thanks for help. Works perfectly.