Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How Can I Change My WalkSpeed Help?

So I created a gui that would change my walkspeed as im the owner? and no error in output just does not change it ? So please help me solve this this is a localScript?

Insert = script.Parent.Parent.CodeInsert.Text
Enter = script.Parent
plr = game.Players.LocalPlayer
plr.PlayerGui.Owner.Owner2.CodeFrame.Enter.MouseButton1Click:connect(function()
local check = game.Workspace:WaitForChild("johndeer2233")
local check1 = check:FindFirstChild("Humanoid")
local check2 = check1.WalkSpeed
check2 = Insert
end)

question?

1 answer

✓ Accepted answer

When you define Insert on line 1, it takes the text in the textbox at that time and will always use that, meaning it can't be changed. You can fix this by removing the .Text on line 1 and adding it to the end of check2 = Insert on line 8. Also, you assigned the WalkSpeed amount to a variable on line 7 local check2 = check1.WalkSpeed. What this means is that if you attempt to change that variable, it would only change the value of the variable, not the actual character's walkspeed. Overall, two small errors that some people may overlook.

Example below :)

Enter = script.Parent
Insert = Enter.Parent.CodeInsert
plr = game.Players.LocalPlayer

plr.PlayerGui.Owner.Owner2.CodeFrame.Enter.MouseButton1Click:connect(function()
	local check = workspace:WaitForChild("johndeer2233")
	local check1 = check:FindFirstChild("Humanoid")
	if check1 then
		check1.WalkSpeed = Insert.Text
	end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.