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)
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.