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
 

Exception players in award player points script?

Previous Thread :: Next Thread 
Maxxell is not online. 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 is not online. Maxxell
Joined: 25 Aug 2009
Total Posts: 38710
13 Jul 2014 01:50 AM
1
Report Abuse
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
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 is not online. 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
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
13 Jul 2014 02:00 AM
Was there any output or..? Does the first script work correctly?
Report Abuse
Maxxell is not online. 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 is not online. 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
CodyTheBuildingKid is not online. CodyTheBuildingKid
Joined: 13 Dec 2011
Total Posts: 4399
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 is not online. 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
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