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 » Scripting Helpers
Home Search
 

Re: Script (need help)

Previous Thread :: Next Thread 
Droben is not online. Droben
Joined: 18 Nov 2012
Total Posts: 54
20 Jul 2013 10:38 PM
Not begging or demanding this script.

So like, can someone help make a leaderboard that says "Flags"?
Player spawns with 0

Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
20 Jul 2013 10:44 PM
local Stats = {
["Flags"] = "IntValue";
["Random String Stat"] = "StringValue";
}

function MakeStats(Player)
local p = instance.new("IntValue",Player)
p.Name = "leaderstats"
for o,n in pairs(Stats) do
Instance.new(n,p).Name = o
end
end

Game.Players.PlayerAdded:connect(MakeStats)
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
20 Jul 2013 10:46 PM
if you want it to work in play solo put this line on the bottom:
for _,n in ipairs(Game.Players:GetPlayers()) do MakeStats(n) end
Report Abuse
baheeg is not online. baheeg
Joined: 19 Jul 2010
Total Posts: 72846
20 Jul 2013 10:47 PM
[ Content Deleted ]
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
20 Jul 2013 10:50 PM
^
That's just wrong.
the pairs iterator function takes a Table as an argument not a number.
Report Abuse
baheeg is not online. baheeg
Joined: 19 Jul 2010
Total Posts: 72846
20 Jul 2013 10:51 PM
[ Content Deleted ]
Report Abuse
Droben is not online. Droben
Joined: 18 Nov 2012
Total Posts: 54
20 Jul 2013 10:53 PM
Thanks, guys! But heres the difficult part

On a side note, do I insert that script into the flag model?

So, how can you make it so if a player already touched the flag, the leaderstats dont change?
Report Abuse
Droben is not online. Droben
Joined: 18 Nov 2012
Total Posts: 54
20 Jul 2013 10:56 PM
Is it like

ifTouched.Player.leaderstats.value ~= nil?
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
20 Jul 2013 11:02 PM
How about you learn how to script then come back. There are great tutorials on youtube.
To to "pighead10" on youtube.
Report Abuse
Droben is not online. Droben
Joined: 18 Nov 2012
Total Posts: 54
20 Jul 2013 11:08 PM
Believe me, I may not be that good, but Im not so bad that I need a repeat :p
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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