#.

32 messages · Page 1 of 1 (latest)

ionic cliff
#

I get coins when I do a certain thing and they display on the leaderboard, but there is also a text that shows your coins on your screen. It is supposed to show "Cash: 1" when you get one coin but it doesn't work
Script:
while true do
wait()
game.StarterGui.CoinsGui.CoinsLabel.Text = "Coins: " .. game.Players.LocalPlayer.leaderstats.Coins.Value
end

ionic cliff
reef orchid
ionic cliff
#

Players - player scripts

crude rampart
reef orchid
#

Ik its because you’re using game.startergui

ionic cliff
reef orchid
#

In startergui

crude rampart
#

alr im busy now if u cant figure it out ill help u later👍

#

just @ me

reef orchid
ionic cliff
#

okay

#

Doesnt quite work

reef orchid
#

No

ionic cliff
#

I tried changing it to "player scripts" but forgot to change the game.StarterGui

reef orchid
#

You’ve gotta change it too

#

Put the script inside the label and paste this:

while true do
  task.wait()
  script.Parent.Text = "Coins: "..game.Players.LocalPlayer.leaderstats.coins.Value
end
ionic cliff
#

still no, should I send my leaderstats script?

cerulean bayBOT
#

studio** You are now Level 2! **studio

ionic cliff
#

game.Players.PlayerAdded:Connect(function(player )
local leaderstats = Instance.new("Folder", player)
leaderstats.Name = "leaderstats"

local coins = Instance.new("IntValue", leaderstats)
coins.Name = "coins"
coins.Value = 100

end)

#

the script is inside ServerScriptService

ionic cliff
reef orchid
#

Np

grave marsh
#

local player = game:GetService("Players").LocalPlayer
local Coins: StringValue = player:WaitForChild("leaderstats"):WaitForChild("coins")

script.Parent.Text = "Coins: " .. Coins.Value

Coins.Changed:Connect(function()
script.Parent.Text = "Coins: " .. Coins.Value
end)

#

or :GetPropertyChangedSignal

reef orchid