✓ Accepted answer
Ok, so what you basically want is a GUI, with a TextLabel saying how much Cash the LocalPlayer has.
First off, you want to make the GUI and theTextLabel before any code. Once you have that, you add in a LocalScript to the GUI. Your hierarchy should look like this:
StarterGui
ScreenGui
LocalScript
TextLabel
Now once you have that, you want to open up your LocalScript and start your script off by adding in the LocalPlayer and the TextLabel as a local variable.
local player = game.Players.LocalPlayer
local textlabel = script.Parent:WaitForChild("TextLabel")
Now that you have made sure that you have go both of the key things, you want to add a while true do loop, so the script is constantly looping, and that way when the players cash.Value changes, so will the text.
while wait() do
end
Now we add in the code inside the loop:
while wait() do
textlabel.Text = player:WaitForChild("leaderstats"):WaitForChild("Cash").Value
end
And now this is what he final script should look:
local player = game.Players.LocalPlayer
local textlabel = script.Parent:WaitForChild("TextLabel")
while wait() do
textlabel.Text = player:WaitForChild("leaderstats"):WaitForChild("Cash").Value
end
I hope this helped and be sure to +1 and accept the answer.
It it doesn't, please be sure to reply with any errors found in the output and I will go back and fix it.
1 comment
How do I make it an overhead GUI?