Local Script (Ignore the part at the top):
local player = game:GetService("Players").LocalPlayer
local PlayerGui = player.PlayerGui
while true do
Money = player:WaitForChild("leaderstats").Money.Value
PlayerGui.ScreenGui.MoneyLabel.Text = "Money: " .. Money
Gems = player:WaitForChild("leaderstats").Gems.Value
PlayerGui.ScreenGui.GemsLabel.Text = "Gems: " .. Gems
wait(.1)
end
function onClicked()
game.ReplicatedStorage.RemoteEvent:FireServer(player)
end
script.Parent.ShopButton.Activated:Connect(onClicked)
Normal Script (Ignore the part at the top):
local function onPlayerJoin(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local Money = Instance.new("IntValue")
Money.Name = "Money"
Money.Value = 0
Money.Parent = leaderstats
local Gems = Instance.new("IntValue")
Gems.Name = "Gems"
Gems.Value = 0
Gems.Parent = leaderstats
end
game.Players.PlayerAdded:Connect(onPlayerJoin)
local MarketplaceService = game:GetService("MarketplaceService")
local productID = 453120071
function OnServerEvent(plr)
MarketplaceService:PromptProductPurchase(plr, productID)
end
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(OnServerEvent)

3 comments
Does not prompt.
maybe edit your last question instead of making a new question
Instead of having a while loop to change the display, use a changed event.