Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i make a textlabel change depending on my walkspeed? (I'll elaborate in bio)

Asked by 4 years ago

So i have a gui that has a textlabel that says "16/416", i need it to increase the number by how much my walkspeed increases if that makes sense.. So i need the label to say "(my walkspeed)/416" depending on my walkspeed. I've tried with putting a Numbervalue in my TextLabel, but didn't know where the local script should go, nor what code should be inside of it. Any help is appreciated. Thank you in advance.

2 answers

Log in to vote
0
Answered by
DogeIXX 172
4 years ago

It is pretty easy. Just put this LocalScript into "StarterPlayerScripts"

local textlabel = --Location of Label
local hum = game.Players.LocalPlayer.Character.Humanoid
while true do
wait(0.1)
textlabel.Text = hum.WalkSpeed .. "/416"
end

I did not test this, so it may not work.

0
You can access the GUIS from Players by game.Players.LocalPlayer.PlayerGui.(GuiName) This works for localscripts only. DogeIXX 172 — 4y
Ad
Log in to vote
0
Answered by
BashGuy10 384 Moderation Voter
4 years ago

Here is a working script to use.

PLACE THE LOCALSCRIPT INSIDE THE TEXTLABEL!

local label = script.Parent
local player = game.Players.LocalPlayer.Character:Wait() and game.Players.LocalPlayer.Character

while wait() do
    label.Text = player.WalkSpeed.."/416"
end)
0
Doesn't work for me. I have it in StarterGui > ScreenGui > Frame > TextLabel (called Speed) > LocalScript. The textlabel says "16/416" by default. TheJacksterYT 19 — 4y
0
Did you make sure the walkspeed is actually changing? DogeIXX 172 — 4y
0
Yes, each time i press 'Q' the speed increases, the max is 416 and min is 16, each time i press 'E' the speed decreases. TheJacksterYT 19 — 4y
0
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm BashGuy10 384 — 4y
View all comments (25 more)
0
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm BashGuy10 384 — 4y
0
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm BashGuy10 384 — 4y
0
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm BashGuy10 384 — 4y
0
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm BashGuy10 384 — 4y
0
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm BashGuy10 384 — 4y
0
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm BashGuy10 384 — 4y
0
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm BashGuy10 384 — 4y
0
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm BashGuy10 384 — 4y
0
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm BashGuy10 384 — 4y
0
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm BashGuy10 384 — 4y
0
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm BashGuy10 384 — 4y
0
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm BashGuy10 384 — 4y
0
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm BashGuy10 384 — 4y
0
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm BashGuy10 384 — 4y
0
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm BashGuy10 384 — 4y
0
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm BashGuy10 384 — 4y
0
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm BashGuy10 384 — 4y
0
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm BashGuy10 384 — 4y
0
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm BashGuy10 384 — 4y
0
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm BashGuy10 384 — 4y
0
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm BashGuy10 384 — 4y
0
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm BashGuy10 384 — 4y
0
Ummmmmm, sorry about that. BashGuy10 384 — 4y
0
That happens sometime BashGuy10 384 — 4y
0
Tell me if you've figured something out TheJacksterYT 19 — 4y

Answer this question