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

Could I make a Gui Button that changes walkspeed?

This is only part of my script. I wanna know how to do it with Instance.new I wanna know how I can make it where I can change my walkspeed to 100 when I click the Walkspeed button which is textbutton1.

walkspeedplr.Name = "WalkSpeedPlr"
walkspeedplr.Position = UDim2.new(0.1, 0, 0.2, 0)
walkspeedplr.Size = UDim2.new(0, 150, 0, 50)
walkspeedplr.Text = "WalkSpeed"
walkspeedplr.Font = Enum.Font.Highway
walkspeedplr.TextScaled = true
walkspeedplr.BackgroundTransparency = 0.5
walkspeedplr.BorderSizePixel = 0
walkspeedplr.Parent = Frame
-- This below is the broken part
walkspeedplr.MouseButton1Click:Connect(function()
	game.Workspace.DiscordID.Humanoid.WalkSpeed = 100
end)

1 answer

✓ Accepted answer

Make sure this is in a LocalScript so LocalPlayer can be used.


local textlabel = Instance.new("TextLabel")
textlabel.Name = "TextLabel"
textlabel.Position = UDim2.new(0, 0, 0, 0)
textlabel.Size = UDim2.new(1, 0, 0.125, 0)
textlabel.Text = "DiscordID's Gui"
textlabel.Font = Enum.Font.SourceSansLight
textlabel.TextScaled = true
textlabel.BackgroundTransparency = 1
textlabel.TextStrokeTransparency = 1
textlabel.Parent = frame

h = game:GetService("Players").LocalPlayer.Character --get the players character
textbutton1.MouseButton1Click:Connect(function()
    h.WalkSpeed = 100 --set the players walkspeed to 100
end)

If there are any issues, please comment below.

3 comments

1

Thank you so much I really appreciate it! :)

1

I just realized that was the wrong piece of information. It says textlabel instead of textbutton :D But you still figured it out I appreicate it!

0

No problem.

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