-
What do you want to achieve? Just a simple gamepass that gives 500 coins
-
What is the issue? Okay, so. The script and gamepass itself works but…The GUI that also has the coin currency is not changing…
-
What solutions have you tried so far? None.

-- local CoinText = script.Parent.Parent.Workspace.Parent.StarterGui.CoinGUI.Frame.Parent.CoinAmount
local gamepassId = 10805450
local stat = "Coins"
local gamepassStat = 500
game.Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder",player)
leaderstats.Name = "leaderstats"
local val = Instance.new("IntValue", leaderstats)
val.Name = "Coins"
val.Value = 100
local awarded = Instance.new("BoolValue", player)
awarded.Name = "Awarded"
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, gamepassId) and player.Awarded.Value == false then
player.Awarded.Value = true
val.Value = val.Value + gamepassStat
CoinText.Text = "Coins:" .. val.Value -- NOT WORKING
end
end)
while wait(3) do
for i, v in pairs(game.Players:GetChildren()) do
if game:GetService("MarketplaceService"):UserOwnGamePassAsync(v.UserId, gamepassId) and v:WaitForChild("Awarded").Value == false then
v.Awarded.Value = true
v.leaderstats:FindFirstChild(stat).Value = v.leaderstats:FindFirstChild(stat)
end
end
end
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.