|
| 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 |
|
|
|
| 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 |
|
|
|
| 24 Oct 2016 03:50 PM |
| Thanks. But where I put this code? Sorry i'm a begginer |
|
|
| Report Abuse |
|
|