|
| 22 Nov 2012 08:47 PM |
--Here is the script, how do I make players lose 50 points if they are killed?
GamePassId = 0
local people = game.Players:GetPlayers() for i = 1,#people do if people[i]:findFirstChild("Dead") then if people[i].Dead.Value == false then people[i].Dead.Value = true people[i].leaderstats.XP.Value = people[i].leaderstats.XP.Value + 100 if (Game:GetService('GamePassService'):PlayerHasPass(people[i],GamePassId)) then people[i].leaderstats.XP.Value = people[i].leaderstats.XP.Value + 100 end people[i].leaderstats.Survivals.Value = people[i].leaderstats.Survivals.Value + 1 end end end end end Main() |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 22 Nov 2012 08:48 PM |
Connect Humanoid Died. Leaderstat Value - 50
DER |
|
|
| Report Abuse |
|
|
|
| 22 Nov 2012 08:50 PM |
| Type it in the script so I can see it. |
|
|
| Report Abuse |
|
|
|
| 22 Nov 2012 08:51 PM |
| Kid, you're not learning to script like this.. |
|
|
| Report Abuse |
|
|
|
| 22 Nov 2012 08:58 PM |
| You're still here? Leave me the freak alone! |
|
|
| Report Abuse |
|
|
|
| 22 Nov 2012 09:01 PM |
"You're still here"
Chop sit's around all day helping people drowning in confusion in this sea we call rbx.lua. So yes, he's still here, where else would he be, living his life? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
crouton04
|
  |
| Joined: 07 Jul 2010 |
| Total Posts: 4459 |
|
|
| 22 Nov 2012 09:20 PM |
| game.Players.Humanoid.Died |
|
|
| Report Abuse |
|
|
Dodeca
|
  |
| Joined: 11 Sep 2011 |
| Total Posts: 13649 |
|
|
| 22 Nov 2012 09:21 PM |
function losePoints() Player.Leaderboard.Stats = Leaderboard.stats(-50) end
This won't work at all.. |
|
|
| Report Abuse |
|
|
|
| 22 Nov 2012 09:24 PM |
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char) char.Humanoid.Died:connect(function() player.leaderstats.Points = player.leaderstats.Points - 50 end) end) end)
Tactical Rainboom Inbound |
|
|
| Report Abuse |
|
|
|
| 22 Nov 2012 09:27 PM |
@Dodeca
Then why did you post it? |
|
|
| Report Abuse |
|
|
|
| 22 Nov 2012 09:28 PM |
@1cool
Can you post that in the whole script so I can see how it fits in with the rest of the script? |
|
|
| Report Abuse |
|
|
|
| 22 Nov 2012 09:38 PM |
I'd rather just recreate your whole script.
GamepassID = 0--Change this to whatever the gamepassid is
game.Players.PlayerAdded:connect(function(player) if game:GetService("GamePassService"):PlayerHasPass(player, GamepassID) then player.leaderstats.XP = player.leaderstats.XP + 100 elseif player.Character.Humanoid.Health ~=0 then wait(60)--change 60 to the time between rounds if player.Character.Humanoid.Health ~= 0 then player.leaderstats.Survivals = player.leaderstats.Survivals + 1 player.CharacterAdded:connect(function(char) char.Humanoid.Died:connect(function() player.leaderstats.Points = player.leaderstats.Points - 50 end end) end) end)
-I dunno if this would work or not, I didn't really think while making it.
Tactical Rainboom Inbound |
|
|
| Report Abuse |
|
|
|
| 22 Nov 2012 09:40 PM |
| I don't want the rounds part. I've already gotten that taken care of. |
|
|
| Report Abuse |
|
|
| |
|
crouton04
|
  |
| Joined: 07 Jul 2010 |
| Total Posts: 4459 |
|
|
| 23 Nov 2012 03:03 PM |
| Shut up and learn to script! |
|
|
| Report Abuse |
|
|
brayden99
|
  |
| Joined: 30 Sep 2007 |
| Total Posts: 1243 |
|
|
| 23 Nov 2012 03:12 PM |
LoseAmount = 50 local Players = Game:GetService("Players") Players.PlayerAdded:connect(function(Player) Player.CharacterAdded:connect(function(Character) local Humanoid = Character:FindFirstChild("Humanoid") if Humanoid then Humanoid.Died:connect(function() Player.leaderstats.Survivals.Value = Player.leaderstats.Survivals.Value - LoseAmount end) end end) end) |
|
|
| Report Abuse |
|
|
brayden99
|
  |
| Joined: 30 Sep 2007 |
| Total Posts: 1243 |
|
|
| 23 Nov 2012 03:13 PM |
| Just put this in a script in Workspace AND it will only work on online mode |
|
|
| Report Abuse |
|
|
| |
|
|
| 23 Nov 2012 03:40 PM |
| Do I add that to the script I already posted? |
|
|
| Report Abuse |
|
|
brayden99
|
  |
| Joined: 30 Sep 2007 |
| Total Posts: 1243 |
|
| |
|
|
| 23 Nov 2012 03:53 PM |
| Do you not have to? Could I just add a new script and put that in the new script? |
|
|
| Report Abuse |
|
|
brayden99
|
  |
| Joined: 30 Sep 2007 |
| Total Posts: 1243 |
|
| |
|
| |
|