Maxxell
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 38710 |
|
|
| 13 Jul 2014 01:39 AM |
I am using this. I want to add an exception so when certain people make a kill they are awarded no player points (me). I've tried a few different things and no luck, how would one do this? Thanks
repeat wait() until script.Parent.Parent.Character
script.Parent.Parent.Character:WaitForChild("Humanoid").Died:connect(function()
if script.Parent.Parent.Character:WaitForChild("Humanoid"):FindFirstChild("creator") then Game:GetService("PointsService"):AwardPoints(script.Parent.Parent.Character:WaitForChild("Humanoid"):FindFirstChild("creator").Value.userId,10)
end end)
|
|
|
| Report Abuse |
|
|
Maxxell
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 38710 |
|
| |
|
|
| 13 Jul 2014 01:51 AM |
local Exceptions = {"Maxxell", "Player2"}
repeat wait() until script.Parent.Parent.Character for i,v in pairs(Exceptions) do Exceptions[v] = true end
script.Parent.Parent.Character:WaitForChild("Humanoid").Died:connect(function()
local creator = script.Parent.Parent.Character:WaitForChild("Humanoid"):FindFirstChild("creator") if creator and not Exceptions[creator.Value.Name] then Game:GetService("PointsService"):AwardPoints(creator.Value.userId,10) end
end)
Try that? |
|
|
| Report Abuse |
|
|
Maxxell
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 38710 |
|
|
| 13 Jul 2014 01:54 AM |
| Didn't work, I can see how the logic there would work though |
|
|
| Report Abuse |
|
|
|
| 13 Jul 2014 02:00 AM |
| Was there any output or..? Does the first script work correctly? |
|
|
| Report Abuse |
|
|
Maxxell
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 38710 |
|
|
| 13 Jul 2014 02:02 AM |
| The first script does work. That one awarded me player points normally. |
|
|
| Report Abuse |
|
|
Maxxell
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 38710 |
|
|
| 13 Jul 2014 02:03 AM |
| Your script awarded me player points normally I mean |
|
|
| Report Abuse |
|
|
|
| 13 Jul 2014 02:14 AM |
local Exceptions = {"Maxxell", "Player1"}
repeat wait() until script.Parent.Parent.Character
for i,v in pairs(Exceptions) do Exceptions[v] = true end
local Human = script.Parent.Parent.Character:WaitForChild("Humanoid")
Human.Died:connect(function() local creator = Human:FindFirstChild("creator")
if creator and not Exceptions[creator.Value.Name] then Game:GetService("PointsService"):AwardPoints(creator.Value.userId,10) end
end)
Well I just tested this and it worked. I'm not super experienced with points and everything but this seemed to work in solo. |
|
|
| Report Abuse |
|
|
Maxxell
|
  |
| Joined: 25 Aug 2009 |
| Total Posts: 38710 |
|
|
| 13 Jul 2014 02:19 AM |
| Indeed it did work! Thanks for the help, I really appreciate it. |
|
|
| Report Abuse |
|
|