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.
01 | walkspeedplr.Name = "WalkSpeedPlr" |
02 | walkspeedplr.Position = UDim 2. new( 0.1 , 0 , 0.2 , 0 ) |
03 | walkspeedplr.Size = UDim 2. new( 0 , 150 , 0 , 50 ) |
04 | walkspeedplr.Text = "WalkSpeed" |
05 | walkspeedplr.Font = Enum.Font.Highway |
06 | walkspeedplr.TextScaled = true |
07 | walkspeedplr.BackgroundTransparency = 0.5 |
08 | walkspeedplr.BorderSizePixel = 0 |
09 | walkspeedplr.Parent = Frame |
10 | -- This below is the broken part |
11 | walkspeedplr.MouseButton 1 Click:Connect( function () |
12 | game.Workspace.DiscordID.Humanoid.WalkSpeed = 100 |
13 | end ) |
Make sure this is in a LocalScript
so LocalPlayer
can be used.
01 | local textlabel = Instance.new( "TextLabel" ) |
02 | textlabel.Name = "TextLabel" |
03 | textlabel.Position = UDim 2. new( 0 , 0 , 0 , 0 ) |
04 | textlabel.Size = UDim 2. new( 1 , 0 , 0.125 , 0 ) |
05 | textlabel.Text = "DiscordID's Gui" |
06 | textlabel.Font = Enum.Font.SourceSansLight |
07 | textlabel.TextScaled = true |
08 | textlabel.BackgroundTransparency = 1 |
09 | textlabel.TextStrokeTransparency = 1 |
10 | textlabel.Parent = frame |
11 |
12 | h = game:GetService( "Players" ).LocalPlayer.Character --get the players character |
13 | textbutton 1. MouseButton 1 Click:Connect( function () |
14 | h.WalkSpeed = 100 --set the players walkspeed to 100 |
15 | end ) |
If there are any issues, please comment below.