generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Game Design
Home Search
 

Re: HELP: 10 coins per 1 minute?

Previous Thread :: Next Thread 
underlord845 is not online. underlord845
Joined: 08 Oct 2014
Total Posts: 99
10 Aug 2016 12:56 PM
I'm making a game and I want the player to gain 10 coins every 1 minute.

I've already got the leaderboard script:

game.Players.PlayerAdded:connect(function(plr)
local stats = Instance.new('IntValue', plr)
stats.Name = 'leaderstats'
local points = Instance.new('IntValue', stats)
points.Name = 'Coins'
points.Value = 0
end)

All I need to know now is how I can get the player to get 10 coins every 1 minute.
Thanks.


Report Abuse
Azure_Kite is not online. Azure_Kite
Joined: 26 Feb 2016
Total Posts: 612
10 Aug 2016 01:04 PM
While wait(60) do
Players = game.Players:GetPlayers()
for i, v in pairs(Players) do
if v:FindFirstChild("leaderstats") do
v.leaderstats.Coins.Value = v.leaderstats.Coins.Value + 10
end
end
end
Report Abuse
Azure_Kite is not online. Azure_Kite
Joined: 26 Feb 2016
Total Posts: 612
10 Aug 2016 01:05 PM
while* with lower case w
Report Abuse
Azure_Kite is not online. Azure_Kite
Joined: 26 Feb 2016
Total Posts: 612
10 Aug 2016 01:06 PM
Put that script in ServerScriptService
Report Abuse
underlord845 is not online. underlord845
Joined: 08 Oct 2014
Total Posts: 99
10 Aug 2016 01:13 PM
Didn't work.


Report Abuse
Azure_Kite is not online. Azure_Kite
Joined: 26 Feb 2016
Total Posts: 612
10 Aug 2016 01:15 PM
Did it give any error? Do you wait for a minute?
Report Abuse
Molten_Legacy is not online. Molten_Legacy
Joined: 23 Aug 2015
Total Posts: 130
10 Aug 2016 02:05 PM
game.Players.PlayerAdded:connect(function(plr)
local stats = Instance.new('IntValue', plr)
stats.Name = 'leaderstats'
local points = Instance.new('IntValue', stats)
points.Name = 'Coins'
points.Value = 0
end)

while wait(60) do
for i, v in pairs(game.Players:GetPlayers()) do
if v:FindFirstChild("leaderstats") then
v.leaderstats:WaitForChild("Coins").Value = v.leaderstats.Coins.Value + 10
end
end
end


You are not prepared.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image