Jetskiis
|
  |
| Joined: 17 Aug 2017 |
| Total Posts: 356 |
|
|
| 26 Nov 2017 04:43 PM |
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
|
|
|
| Report Abuse |
|
|
AsharKYT
|
  |
| Joined: 18 Jun 2017 |
| Total Posts: 174 |
|
|
| 26 Nov 2017 04:58 PM |
| LOL! you don't even have BC..... I think you failed pretty bad trying to lie.... |
|
|
| Report Abuse |
|
|
Jetskiis
|
  |
| Joined: 17 Aug 2017 |
| Total Posts: 356 |
|
|
| 26 Nov 2017 04:59 PM |
I can pay via buying a t-shirt y,know?
Haters will be considered free bumpers.
|
|
|
| Report Abuse |
|
|
Scrippa
|
  |
| Joined: 25 Dec 2011 |
| Total Posts: 20289 |
|
| |
|
Jetskiis
|
  |
| Joined: 17 Aug 2017 |
| Total Posts: 356 |
|
| |
|
Jetskiis
|
  |
| Joined: 17 Aug 2017 |
| Total Posts: 356 |
|
| |
|
|
| 26 Nov 2017 05:27 PM |
| Got Discordee? add me: GodHOLINALILIUS#9156 lol ik. |
|
|
| Report Abuse |
|
|
Jetskiis
|
  |
| Joined: 17 Aug 2017 |
| Total Posts: 356 |
|
|
| 26 Nov 2017 05:41 PM |
| ? Why would we need to use#######d? |
|
|
| Report Abuse |
|
|
Jetskiis
|
  |
| Joined: 17 Aug 2017 |
| Total Posts: 356 |
|
| |
|
Jetskiis
|
  |
| Joined: 17 Aug 2017 |
| Total Posts: 356 |
|
| |
|
|
| 26 Nov 2017 06:50 PM |
the handleKillCount function is inside the onHumanoidDied function
|
|
|
| Report Abuse |
|
|
Jetskiis
|
  |
| Joined: 17 Aug 2017 |
| Total Posts: 356 |
|
|
| 26 Nov 2017 06:59 PM |
So I should just put it inside ?
|
|
|
| Report Abuse |
|
|
|
| 26 Nov 2017 07:10 PM |
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
|
|
|
| Report Abuse |
|
|
Jetskiis
|
  |
| Joined: 17 Aug 2017 |
| Total Posts: 356 |
|
|
| 26 Nov 2017 07:11 PM |
The wipeouts are working but KO's arent :/
|
|
|
| Report Abuse |
|
|
|
| 26 Nov 2017 07:17 PM |
getKillerOfHumanoidIfStillInGame()
may I see how this function works?
|
|
|
| Report Abuse |
|
|
Jetskiis
|
  |
| Joined: 17 Aug 2017 |
| Total Posts: 356 |
|
|
| 26 Nov 2017 07:24 PM |
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
|
|
|
| Report Abuse |
|
|
|
| 26 Nov 2017 08:00 PM |
| ######### # don't have BC, and yet I can still afford to get some ROBUX. |
|
|
| Report Abuse |
|
|