1. Don't set properties as variables, but the objects:
a = script.Parent.Parent.Parent.Parent.Parent.Parent.StarterPack.Coins
script.Parent.Text = a.Value.."MC"
2. Use changed event and not a while true loop to update the value, it will eat less resources:
a = script.Parent.Parent.Parent.Parent.Parent.Parent.StarterPack.Coins
a.Changed:connect(function()
script.Parent.Text = a.Value.."MC"
end)
3. Using local on variables eat less resources:
local a = script.Parent.Parent.Parent.Parent.Parent.Parent.StarterPack.Coins
a.Changed:connect(function()
script.Parent.Text = a.Value.."MC"
end)
4. Why starterpack? On ServerScriptService, insert a script, which contains the code:
game.Players.PlayerAdded:connect(function(player)
local val = Instance.new("IntValue")
val.Name = "Coins"
val.Parent = player
val.Value = 500000
player.PlayerGui.ScreenGui.fefe.fefhtuy.ggrgd.af.Text = val.Value.."MC"
val.Changed:connect(function()
player.PlayerGui.ScreenGui.fefe.fefhtuy.ggrgd.af.Text = val.Value.."MC"
end)
end)
1 comment
Output or it never happened.