Why Nostr? What is Njump?
2023-02-09 16:25:21

TZH on Nostr: Random give money -- Define a function to give money local function giveMoney() -- ...

Random give money
-- Define a function to give money
local function giveMoney()

-- Choose a random amount of money to give (between 1 and 100)
local amount = math.random(1, 100)

-- Update the player's money with the amount
game.Players.LocalPlayer.leaderstats.Money.Value = game.Players.LocalPlayer.leaderstats.Money.Value + amount

-- Print a message to the player with the amount of money received
print("You received " .. amount .. " coins!")
end

-- Call the function every 5 seconds
while true do
wait(5)
giveMoney()
end
Author Public Key
npub1e3axwaz52trqqftmxg2v0r24n400vudfkf6gylztm84aw5ut3agsydvk4e