We have a description of the boost, and, I want it to display how much boost you get from it: (you have +x speed boost). I have a stat called “Speed” which is set to the player’s speed (16) and I want to do that it takes this stat and based on it, calculates the speed boost (local x = speed - 16)
Here’s what I have so far:
game.Players.PlayerAdded:Connect(function(plr)
if plr:WaitForChild("Other"):WaitForChild("Gems") then
while wait(0.5) do
local gems = plr.Other.Gems.Value
local speed = plr.Other.Speed.Value
speed -= 16
print(speed)
script.Parent.Parent.TextLabel.Text = "Speed: Gain +2 speed everytime you buy this upgrade! (you have +"..speed.." speed boost)"
end
end
end)
Here is my GUI hierarchy:
It should print the speed value and change the text but nothing seems to happen. No printed out message and the text didn’t change…
How could I fix this? Thanks!
Yes, but, use game:GetService("Players") and save it as a variable, i personally think that’s better than doing game.Players idk if theres much of a difference but it’s a preference nothing more.