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: Can someone fix this please?

Previous Thread :: Next Thread 
memro is not online. memro
Joined: 08 Aug 2011
Total Posts: 10605
11 Jun 2014 01:35 PM
I just want it to reward a player 90 Player Points when they manage to kill me.

game.Players.PlayerAdded:connect(function(p)
repeat wait() until p.Character
p.Character.Humanoid.Died:connect(function()
if p.Character.Humanoid:FindFirstChild("memro") then
game:GetService("PointsService"):AwardPoints(p.userId,90)
end
end)
end)

p.CharacterAdded:connect(function(c)
c.Humanoid.Died:connect(function()
if c.Humanoid:FindFirstChild("memro") then
game:GetService("PointsService"):AwardPoints(p.userId,90)
end
end)
end)
Report Abuse
Trioxide is not online. Trioxide
Joined: 29 Mar 2011
Total Posts: 32902
11 Jun 2014 01:39 PM
Go in-game, press F9, tell errors.
Report Abuse
memro is not online. memro
Joined: 08 Aug 2011
Total Posts: 10605
11 Jun 2014 01:43 PM
I'll get back to you in just a sec
Report Abuse
memro is not online. memro
Joined: 08 Aug 2011
Total Posts: 10605
11 Jun 2014 01:51 PM
There aren't any related errors :/
Report Abuse
4444vince2 is not online. 4444vince2
Joined: 08 Nov 2008
Total Posts: 4880
11 Jun 2014 02:12 PM
Did you have someone kill you? Cause it wont throw an error until the script is ran. :P
Report Abuse
memro is not online. memro
Joined: 08 Aug 2011
Total Posts: 10605
11 Jun 2014 02:12 PM
I changed it up a bit and when he killed me I got the 90 points and not him. ugh this is so difficult


local playerName = "memro"
local service = game:GetService("PointsService")

game.Players.PlayerAdded:connect(function(p)
repeat wait() until p.Character
p.Character.Humanoid.Died:connect(function()
if string.lower(p.Name) == string.lower(playerName) then
if p.Character.Humanoid:FindFirstChild("creator") then
game:GetService("PointsService"):AwardPoints(p.userId,90)
end
end
end)
p.CharacterAdded:connect(function(c)
c.Humanoid.Died:connect(function()
if string.lower(p.Name) == string.lower(playerName) then
if c.Humanoid:FindFirstChild("creator") then
game:GetService("PointsService"):AwardPoints(p.userId,90)
end
end
end)
end)
end)
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