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 » Scripters
Home Search
 

Re: LeadBoard kill/points

Previous Thread :: Next Thread 
Mathissimo10 is not online. Mathissimo10
Joined: 24 Sep 2016
Total Posts: 4
23 Oct 2016 08:23 PM
I add a leadboard to my game with this script: https://www.roblox.com/library/148700132/Leaderboard-Plugin

The fallowing script/code have been added:

function onEnter(player)

local ld = Instance.new("IntValue",player)
ld.Name = "leaderstats"
local value1 = Instance.new("IntValue",ld)
value1.Name = "Kills"
value1.Value = 0

end

game.Players.PlayerAdded:connect(onEnter)

for i,v in pairs(game.Players:players()) do -- So that it works in Play Solo.
onEnter(v)
end


Now I would like to now how can I add one Value when someone kill an other person.



Sorry if you don't understand everythings, i'm french.
Report Abuse
TehIcyStar is not online. TehIcyStar
Joined: 07 Mar 2010
Total Posts: 1649
23 Oct 2016 08:31 PM
You're going to have to have the code that adds points inside of wherever you deal damage. So in your case, that would be inside of the weapon.

Here's what it would look like inside of a gun

local humanoidToDealDamageTo = ThingThatBulletHit.Parent:FindFirstChild("Humanoid")
if humanoidToDealDamageTo then --check if the thing we hit has a humanoid, nil is false!
humanoidToDealDamageTo.Health = humanoidToDealDamageTo.Health - 25 --deal damage
if humanoidToDealDamageTo.Health <= 0 then --check if dead
--award points
end
end
Report Abuse
Mathissimo10 is not online. Mathissimo10
Joined: 24 Sep 2016
Total Posts: 4
24 Oct 2016 03:50 PM
Thanks. But where I put this code? Sorry i'm a begginer
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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