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: Help stat's

Previous Thread :: Next Thread 
jaredvaldez2 is not online. jaredvaldez2
Joined: 01 Apr 2008
Total Posts: 658
13 Jul 2011 12:00 AM
print("Best Ever Leaderboard by stickmasterluke")
--made by Stickmasterluke

--Thanks to who ever made or helped make Leaderboard 5.0 because i based this leaderboard off of 5.0
--so i guess this is 6.0?
stands = {}
CTF_mode = false

function onHumanoidDied(humanoid, player)
local stats = player:findFirstChild("leaderstats")
if stats ~= nil then
local deaths = stats:findFirstChild("Spree")
deaths.Value=0
local deaths2 = player:findFirstChild("ss")
deaths2.Value=0
local deaths3 = stats:findFirstChild("Resources")
deaths3.Value=deaths3.Value-1
if deaths3.Value<0 then
deaths3.Value=0
end
local msg=player:findFirstChild("Speed Spree")
if msg~=nil then
msg:remove()
end

local killer = getKillerOfHumanoidIfStillInGame(humanoid)

handleKillCount(humanoid, player)
end
end

function onPlayerRespawn(property, player)

if property == "Character" and player.Character ~= nil then
local humanoid = player.Character.Humanoid
local p = player
local h = humanoid
humanoid.Died:connect(function() onHumanoidDied(h, p) end )
end
end

function getKillerOfHumanoidIfStillInGame(humanoid)

local tag = humanoid:findFirstChild("creator")

if tag ~= nil then

local killer = tag.Value
if killer.Parent ~= nil then
return killer
end
end

return nil
end

function handleKillCount(humanoid, player)
local killer = getKillerOfHumanoidIfStillInGame(humanoid)
if killer ~= nil then
if killer ~= player then
local stats = killer:findFirstChild("leaderstats")
local stats2 = killer:findFirstChild("ss")
if stats ~= nil and stats2 ~= nil then
if killer.TeamColor == player.TeamColor and killer.Neutral==false then
stats2.Value=0
local kills = stats:findFirstChild("Resources")
kills.Value = kills.Value - 2
local kills2 = stats:findFirstChild("Spree")
kills2.Value = kills2.Value - 1
if kills.Value<0 then
kills.Value=0
end
if kills2.Value<0 then
kills2.Value=0
end
else
stats2.Value=stats2.Value+1
local kills = stats:findFirstChild("Resources")
kills.Value = kills.Value + 2
local kills2 = stats:findFirstChild("Spree")
kills2.Value = kills2.Value + 1
end
end
end
end
end

function findAllFlagStands(root)
local c = root:children()
for i=1,#c do
if (c[i].className == "Model" or c[i].className == "Part") then
findAllFlagStands(c[i])
end
if (c[i].className == "FlagStand") then
table.insert(stands, c[i])
end
end
end

function hookUpListeners()
for i=1,#stands do
stands[i].FlagCaptured:connect(onCaptureScored)
end
end

function onPlayerEntered(newPlayer)

local spco=script.spreecounter:clone()

local val=Instance.new("IntValue")
val.Name="ss"
val.Value=0
val.Parent=newPlayer
local stats3 = Instance.new("IntValue")
stats2.Name = "Tycoon"

local stats = Instance.new("IntValue")
cash.Name = "Money"
cash.Value = 0

local kills = Instance.new("IntValue")
kills.Name = "Resources"
kills.Value = 2

local deaths = Instance.new("IntValue")
deaths.Name = "Spree"
deaths.Value = 0

kills.Parent = stats
deaths.Parent = stats
stats3.Parent = newPlayer
stats.Parent = newPlayer

while true do
if newPlayer.Character ~= nil then break end
wait(5)
end

local humanoid = newPlayer.Character.Humanoid

humanoid.Died:connect(function() onHumanoidDied(humanoid, newPlayer) end )

newPlayer.Changed:connect(function(property) onPlayerRespawn(property, newPlayer) end )

stats.Parent = newPlayer

local val2=Instance.new("ObjectValue")
val2.Name="playah"
val2.Value=stats.Parent
val2.Parent=spco
print("a " .. val2.className .. " has been added to " .. newPlayer.Name)
print(val2.className .. "'s value is " .. val2.Value.Name)

spco.Disabled=false
spco.Parent=game.Workspace

end


function onCaptureScored(player)
local ls = player:findFirstChild("leaderstats")
if ls == nil then return end
local caps = ls:findFirstChild("Resources")
if caps == nil then return end
caps.Value = caps.Value + 20
end


findAllFlagStands(game.Workspace)
hookUpListeners()
if (#stands > 0) then CTF_mode = true end
game.Players.ChildAdded:connect(onPlayerEntered)

Can someone heelp? i want money to be the 3rd stat,s
and let it be a tycoon stats
Report Abuse
Pichu7245 is not online. Pichu7245
Joined: 17 May 2009
Total Posts: 16489
13 Jul 2011 12:10 AM
I just shoved a man-eating hamster in my face because this is so dumb.

First of all, this is a free model. It says "stickmasterluke" at the top.
Secondly, no requests.
Third, this is COMPLETELY inefficient.
Report Abuse
jaredvaldez2 is not online. jaredvaldez2
Joined: 01 Apr 2008
Total Posts: 658
13 Jul 2011 12:12 AM
This forum is for help only please do not post off topic forums.
Report Abuse
Pichu7245 is not online. Pichu7245
Joined: 17 May 2009
Total Posts: 16489
13 Jul 2011 12:18 AM
Show me where I posted the link to an off topic forum.
You're not asking for help. You're trying to manipulate others to fix your free model script. You will not learn anything unless you try and fix it yourself.
Report Abuse
XJeffXNeroXPPV1 is not online. XJeffXNeroXPPV1
Joined: 03 Nov 2010
Total Posts: 11250
13 Jul 2011 12:20 AM
HI JARED
Report Abuse
ROBLOcasno is not online. ROBLOcasno
Joined: 20 Dec 2009
Total Posts: 11769
13 Jul 2011 12:21 AM
It says it was made by stickmasterluke at the top...
-_-'
Report Abuse
Snowtroper7 is not online. Snowtroper7
Joined: 26 Sep 2008
Total Posts: 4368
13 Jul 2011 12:22 AM
Fail, the top says made by SML.
Report Abuse
NINJAKID09 is not online. NINJAKID09
Joined: 27 Aug 2009
Total Posts: 14392
13 Jul 2011 12:23 AM
I can't help if you wont explain the problem.
Report Abuse
NINJAKID09 is not online. NINJAKID09
Joined: 27 Aug 2009
Total Posts: 14392
13 Jul 2011 12:23 AM
Oh, a request.

Requests aren't allowed on this forum.
Report Abuse
blaston99999 is not online. blaston99999
Joined: 01 Jan 2009
Total Posts: 1308
13 Jul 2011 12:26 AM
This is just plain stupid..
Report Abuse
dannyman987 is not online. dannyman987
Joined: 20 Dec 2009
Total Posts: 296
13 Jul 2011 02:23 AM
I Wonder if jared is finally making his own games now...

dannyman987: Jared, you making your own games now?

jaredvaldez2: Y...Ummmm.......*Runs Off Crying To Mum.*
Report Abuse
Koloss is not online. Koloss
Joined: 14 Jul 2006
Total Posts: 202
13 Jul 2011 02:33 AM
Jared... you're freakin stupid.
Report Abuse
xxshameless is not online. xxshameless
Joined: 27 Feb 2010
Total Posts: 10463
13 Jul 2011 09:54 AM
Lolyoufailed.
So are you actually making a new game?
Report Abuse
juriaan is not online. juriaan
Joined: 25 Nov 2008
Total Posts: 939
13 Jul 2011 10:14 AM
--[[Tycoon Stats by Juriaan]]

function Playerl(newplayer)
local leaderstats = Instance.new("IntValue", newplayer)
leaderstats.Name = "leaderstats" --[[ Change this in too Setup if you wish to NOT show it on the player list]]
local Tycoon = Instance.new("IntValue", newplayer.leaderstats)
Tycoon.Name = "Tycoon"
local Resources = Instance.new("IntValue", newplayer.leaderstats)
Resources.Name = "Resources"
local Money = Instance.new("NumberValue", newplayer.leaderstats)
Money.Name = "Money"
end

--[[ Note : To let this Script work you would need the next:
- Change all the leaderstats too the Name that you give to the next line :
leaderstats.Name
- Too Tagg a Value inside this you would do the next
newplayer.THENAMEOFLEADERSTATSHERE.WHATYOUWISHTOTAGG
or just if you are inside the Player Folder then
THENAMEOFLEADERSTATSHERE.WHATYOUWISHTOTAGG
- To make a Value inside the Value do the next
For Example:
Money.Value = 20
]]


Juriaan





Game.Players.ChildAdded:connect(Playerl
Report Abuse
Fl0x is not online. Fl0x
Joined: 06 Aug 2010
Total Posts: 5169
13 Jul 2011 10:18 AM
I just realized I posted on this thread.
Report Abuse
OmgFlyingSpaceCow is not online. OmgFlyingSpaceCow
Joined: 16 Dec 2009
Total Posts: 564
13 Jul 2011 10:25 AM
Hahaha, jared, you're such a moron....
Report Abuse
xSoulStealerx is not online. xSoulStealerx
Joined: 07 May 2008
Total Posts: 1624
13 Jul 2011 10:46 AM
OH NO
The worst succesful game copier strikes in the forum.
Report Abuse
eXoguti093 is not online. eXoguti093
Joined: 17 Oct 2008
Total Posts: 1786
13 Jul 2011 11:04 AM
Jared fails, learn how to script noob
Report Abuse
eXoguti093 is not online. eXoguti093
Joined: 17 Oct 2008
Total Posts: 1786
13 Jul 2011 11:05 AM
OMGOMG THIS SHOWS THAT JARED CAN'T SCRIPT AND HE DIDNT MAKE HIS GAMES!!!!!! PROOF
Report Abuse
chikenugget is not online. chikenugget
Joined: 09 May 2009
Total Posts: 2552
13 Jul 2011 11:08 AM
@eXo

We already knew.. :3
Report Abuse
eXoguti093 is not online. eXoguti093
Joined: 17 Oct 2008
Total Posts: 1786
13 Jul 2011 11:09 AM
I know but its proof for the noobs who like jared that jared is a noob!!! haha he didnt think this through, this is some proof :D
Report Abuse
jaredvaldez2 is not online. jaredvaldez2
Joined: 01 Apr 2008
Total Posts: 658
13 Jul 2011 11:11 AM
Proof? I'm asking for scripting help , i'm not a good script er idiot.
Report Abuse
61352151511 is not online. 61352151511
Joined: 30 Nov 2009
Total Posts: 8094
13 Jul 2011 11:14 AM
So you just want to add a new stat in? Do you want to take the other ones out too?

~ Mitch ~
Report Abuse
eXoguti093 is not online. eXoguti093
Joined: 17 Oct 2008
Total Posts: 1786
13 Jul 2011 11:15 AM
Your not a good scripter, and some of those games have more advanced scripting, this is simple to use and you can't, if you can't edit this, you can't make games like that.
Report Abuse
PompeyTheGreat is not online. PompeyTheGreat
Joined: 10 Apr 2011
Total Posts: 5615
13 Jul 2011 11:16 AM
Do you just want a tycoon leaderboard? If so, here.

game.Players.PlayerAdded:connect(function(plr)
stats = Instanc.new("IntValue",plr)
stats.Name = "leaderstats"
money = Instance.new("IntValue",stats)
money.Name = "PutNameOfMoneyHere" --Put your money name here
money.Value = 0 --Change 0 to a starter cash value
onstyc = Instance.new("IntValue",plr)
onstyc.Name = "Tycoon"
end)


??
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