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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 04 Aug 2011 |
| Total Posts: 371 |
|
|
| 09 Aug 2011 05:11 PM |
| Still no. It's hard to explain. |
|
|
| Report Abuse |
|
|
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 |
|
|