Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Change the walkspeed depending on number for ex :ws 50, :ws 30?

Asked by 4 years ago

I have no idea what I am doing and what I should do, when player types :ws 60 for example, the walkspeed goes to 60, if the player tpyes :ws 20 then it goes to 20.

0
Not a request forum, look it up and try it out yourself first. RunKittenzRComin 170 — 4y
0
If you have no idea what to do. I recommend looking up the Developer Wiki and learn the things that are relevant to your script. rabbi99 714 — 4y

1 answer

Log in to vote
-2
Answered by 4 years ago
local Players=game:GetService"Players"
local function admincmds(player,msg)
    msg=string.split(msg," ")
    local cmd,ws=msg[1],msg[2]
    ws=ws and tonumber(ws)
    if cmd==":ws" and ws then
    local h=player.Character;h=h and h:FindFirstChildOfClass"Humanoid"  
    h.WalkSpeed=ws
    end
end
local function onPlayerAdded(player)
player.Chatted:Connect(function(t)
admincmds(player,t)
end)
end
Players.PlayerAdded:Connect(onPlayerAdded)
for _,v in ipairs(Players:GetPlayers())do onPlayerAdded(v)end
1
your script is so messy AnasBahauddin1978 715 — 4y
Ad

Answer this question