I'm pretty new at scripting and i've been working on a gui to change your walkspeed. I've made a TextBox where you type in a number and a TextButton that you click to change your walkspeed to the number. If I make the number 16 in studio and then test it, my speed will be changed to 16 (the default speed) However, when I change the text and click the TextButton, it stays at 16.

Here is the LocalScript in the Textbutton

local player = game.Players.LocalPlayer
local char = player.Character
local text = script.Parent.Parent.SpeedBox.Text
script.Parent.MouseButton1Click:connect(function()
char.Humanoid.WalkSpeed = text
print("current speed =",text)
end)

There are no Errors in the output, if someone could help me out i'd appreciate it.

Here is the full GUI

3 comments

0

You're assigning a string to a value that should be a number, use char,Humanoid.WalkSpeed = tonumber(text)

0

Also you need to add a infinite loop to check it. You can do like, local enabled = true; while wait() and enabled == true do (the code thingy); enabled = false, breaking the loop

0

So far these solutions haven't worked, if you need to look at the full gui go ahead and do so https://ghostbin.com/paste/tc85w/raw