Hey guys,
I'm making a tycoon. When they start the game they start with 0 cash. They have the ability to purchase a free house and a free 'sawmill' (which earns them income).
I'm selling a Game Pass for 200 Robux that allows you to start with 500,000 cash. How can I make it so when they enter with a pass, they can start with this amount of cash?
Here's my leader board script:
print("Cash Stuffs running!")
function onPlayerEntered(newPlayer)
wait(.5)
local stats = Instance.new("IntValue")
stats.Name = "leaderstats"
local stats2 = Instance.new("IntValue")
stats2.Name = "Tycoon"
local cash = Instance.new("IntValue")
cash.Name = "Cash"
cash.Value = 0
cash.Parent = stats
stats2.Parent = newPlayer
stats.Parent = newPlayer
end
game.Players.ChildAdded:connect(onPlayerEntered)
Here's what I'm having trouble trying to implement:
local passId = 382425941 -- change this to your game pass ID.
function isAuthenticated(player) -- checks to see if the player owns your pass
return game:GetService("MarketplaceService"):PlayerOwnsAsset(player, passId)
end
game.Players.PlayerAdded:connect(function(plr)
if isAuthenticated(plr) then
cash.Value = 500,000
end
end)
Any help would be GREATLY appreciated!
