JetskiisJoin Date: 2017-08-17 Post Count: 356 |
Kills are not going into the leaderboard while deaths are.
I'm using a custom made tool to allow players to kill other players
function onHumanoidDied(humanoid, player)
local stats = player:findFirstChild("leaderstats")
if stats ~= nil then
local deaths = stats:findFirstChild("Wipeouts")
deaths.Value = deaths.Value + 1
function handleKillCount(humanoid, player)
local killer = getKillerOfHumanoidIfStillInGame(humanoid)
if killer ~= nil then
local stats = killer:findFirstChild("leaderstats")
if stats ~= nil then
local kills = stats:findFirstChild("KOs")
if killer ~= player then
kills.Value = kills.Value + 1
else
kills.Value = kills.Value - 1
end
end
end
end
|
|
AsharKYTJoin Date: 2017-06-18 Post Count: 174 |
LOL! you don't even have BC..... I think you failed pretty bad trying to lie.... |
|
JetskiisJoin Date: 2017-08-17 Post Count: 356 |
I can pay via buying a t-shirt y,know?
Haters will be considered free bumpers.
|
|
ScrippaJoin Date: 2011-12-25 Post Count: 20289 |
@Ashar
stop being idiot
|
|
JetskiisJoin Date: 2017-08-17 Post Count: 356 |
bump
|
|
JetskiisJoin Date: 2017-08-17 Post Count: 356 |
b1
|
|
|
Got Discordee? add me: GodHOLINALILIUS#9156 lol ik. |
|
JetskiisJoin Date: 2017-08-17 Post Count: 356 |
? Why would we need to use#######d? |
|
JetskiisJoin Date: 2017-08-17 Post Count: 356 |
b
|
|
JetskiisJoin Date: 2017-08-17 Post Count: 356 |
b1
|
|
|
the handleKillCount function is inside the onHumanoidDied function
|
|
JetskiisJoin Date: 2017-08-17 Post Count: 356 |
So I should just put it inside ?
|
|
|
pretty much you just have to add an end to the first function
function onHumanoidDied(humanoid, player)
local stats = player:findFirstChild("leaderstats")
if stats ~= nil then
local deaths = stats:findFirstChild("Wipeouts")
deaths.Value = deaths.Value + 1
end -- you forgot these two ends
end
function handleKillCount(humanoid, player)
local killer = getKillerOfHumanoidIfStillInGame(humanoid)
if killer ~= nil then
local stats = killer:findFirstChild("leaderstats")
if stats ~= nil then
local kills = stats:findFirstChild("KOs")
if killer ~= player then
kills.Value = kills.Value + 1
else
kills.Value = kills.Value - 1
end
end
end
end
|
|
JetskiisJoin Date: 2017-08-17 Post Count: 356 |
The wipeouts are working but KO's arent :/
|
|
|
getKillerOfHumanoidIfStillInGame()
may I see how this function works?
|
|
JetskiisJoin Date: 2017-08-17 Post Count: 356 |
Full script with some minor edits i made
Wipeouts work as intended but Knockouts don't work whatsoever when I kill someone with my revolver i have
beta=false
function onHumanoidDied(humanoid, player)
local stats = player:findFirstChild("leaderstats")
if stats ~= nil then
local deaths = stats:findFirstChild("Wipeouts")
deaths.Value = deaths.Value + 1
local killer = getKillerOfHumanoidIfStillInGame(humanoid)
handleKillCount(humanoid, player)
end
end
function onPlayerRespawn(property, player)
if property == "Character" and player.Character ~= nil then
local humanoid = player.Character.Humanoid
local p = player
local h = humanoid
humanoid.Died:connect(function() onHumanoidDied(h, p) end )
end
end
function getKillerOfHumanoidIfStillInGame(humanoid)
-- check for kill tag on humanoid - may be more than one - todo: deal with this
local tag = humanoid:findFirstChild("creator")
-- find player with name on tag
if tag ~= nil then
local killer = tag.Value
if killer.Parent ~= nil then -- killer still in game
return killer
end
end
return nil
end
function handleKillCount(humanoid, player)
local killer = getKillerOfHumanoidIfStillInGame(humanoid)
if killer ~= nil then
local stats = killer:findFirstChild("leaderstats")
if stats ~= nil then
local kills = stats:findFirstChild("KOs")
if killer ~= player then
kills.Value = kills.Value + 1
else
kills.Value = kills.Value - 1
end
end
end
end
function onPlayerEntered(newPlayer)
if beta == true then
local stats = Instance.new("IntValue")
stats.Name = "leaderstats"
local captures = Instance.new("IntValue")
captures.Name = "Captures"
captures.Value = 0
captures.Parent = stats
while true do
if newPlayer.Character ~= nil then break end
wait(5)
end
stats.Parent = newPlayer
else
local stats = Instance.new("IntValue")
stats.Name = "leaderstats"
local kills = Instance.new("IntValue")
kills.Name = "KOs"
kills.Value = 0
local deaths = Instance.new("IntValue")
deaths.Name = "Wipeouts"
deaths.Value = 0
kills.Parent = stats
deaths.Parent = stats
while true do
if newPlayer.Character ~= nil then break end
wait(5)
end
local humanoid = newPlayer.Character.Humanoid
humanoid.Died:connect(function() onHumanoidDied(humanoid, newPlayer) end )
-- start to listen for new humanoid
newPlayer.Changed:connect(function(property) onPlayerRespawn(property, newPlayer) end )
stats.Parent = newPlayer
end
end
|
|
|
######### # don't have BC, and yet I can still afford to get some ROBUX. |
|