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: simple leaderboard(Wipeouts)

Previous Thread :: Next Thread 
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
09 Aug 2011 03:36 PM
Would this work?

function PlayerAdded(Player)
InA = Instance.new("IntValue",Player)
InA.Name = "leaderstat"
InA.Value = 0
InB = Instance.new("IntValue",InA)
InB.Name = "Wipeouts"
InB.Value = 0
if Workspace.Player.Humanoid.Health = 0 then
InB.Value = InB.Value +1
end
end

game.Players.PlayerAdded:connect(PlayerAdded)
Report Abuse
Nexun is not online. Nexun
Joined: 04 Aug 2011
Total Posts: 371
09 Aug 2011 03:39 PM
game.Players.PlayerAdded:connect(function(p)
local stats = Instance.new("IntValue", p)
stats.Name = "leaderstats"
local WOs = Instance.new("IntValue", stats)
WOs.Name = "Wipeouts"
WOs.Value = 0
local KOs = Instance.new("IntValue", stats)
KOs.Name = "Knockouts"
KOs.Value = 0
end)

game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(c)
c.Humanoid.Died:connect(function()
local stats = p:findFirstChild("leaderstats")
if stats then
local WOs = stats:findFirstChild("Wipeouts")
if WOs then
pcall(function() --pcall() because maybe the player left
WOs.Value = WOs.Value + 1
end)
end
end
end)
end)
end)
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
09 Aug 2011 03:41 PM
I just want to know the wipeouts-_- Would MY script work?
Report Abuse
Nexun is not online. Nexun
Joined: 04 Aug 2011
Total Posts: 371
09 Aug 2011 03:41 PM
@miz

Yours wouldn't work because:

1. It would only work on one person named 'Player', and no one else.
2. It would only run once every time a player entered your game.
3. You don't have two equal signs.

Mine will work, though.
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
09 Aug 2011 04:10 PM
function PlayerAdded(Player)
InA = Instance.new("IntValue",Players)
InA.Name = "leaderstats"
InA.Value = 0
InB = Instance.new("IntValue",InA)
InB.Name = "Wipeouts"
InB.Value = 0
if Workspace.Player.Humanoid.Health = 0 then
InB.Value == InB.Value +1
end
end

game.Players.PlayerAdded:connect(PlayerAdded)

Now will it work?
Report Abuse
Nexun is not online. Nexun
Joined: 04 Aug 2011
Total Posts: 371
09 Aug 2011 04:17 PM
No.

'if Workspace.Player.Humanoid.Health = 0 then'

Workspace.Player only gets ONE person whose name is player, it will not refer to your argument in any way whatsoever. It will just search for a character model in Workspace named Player. And you need two equal signs, as I said before. You didn't have to change the other equal sign.
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
09 Aug 2011 04:21 PM
Ok, what if I say Players.Player? Instead of Workspace.Player?
Report Abuse
Nexun is not online. Nexun
Joined: 04 Aug 2011
Total Posts: 371
09 Aug 2011 05:11 PM
Still no. It's hard to explain.
Report Abuse
miz656 is not online. miz656
Joined: 19 Jul 2010
Total Posts: 15336
09 Aug 2011 10:47 PM
Nexun, I want someone to improve my script.I don't want to take another persons script that I don't even no how they made it.I want to know whats wrong with MY SCRIPT AND HOW CAN I FIX IT
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