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

WalkSpeed With A TextBox?

Asked by 4 years ago

I would make a button that gives you the walkspeed you entered in a textbox in a GUI. But i got errors and i don't find any post with the answer. Please help me! This is my current script (Its a LocalScript):

local plr = game.Players.LocalPlayer.Character.Humanoid
local numb = script.Parent.Parent.WsNumber.Text

script.Parent.MouseButton1Click:Connect(function()
plr.WalkSpeed = numb
end)
0
You can use tonumber in the script, because the WsNumber is a string, so maybe use tonumber.. The answer is already down there. Xapelize 2658 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

change:

local numb = script.Parent.Parent.WsNumber.Text

to:

local numb = tonumber(script.Parent.Parent.WsNumber.Text)
Ad

Answer this question