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: 50 robux to fix this script

Previous Thread :: Next Thread 
Jetskiis is online. 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 is online. 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 is online. 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 is not online. Scrippa
Joined: 25 Dec 2011
Total Posts: 20289
26 Nov 2017 05:03 PM
@Ashar

stop being idiot


Report Abuse
Jetskiis is online. Jetskiis
Joined: 17 Aug 2017
Total Posts: 356
26 Nov 2017 05:15 PM
bump


Report Abuse
Jetskiis is online. Jetskiis
Joined: 17 Aug 2017
Total Posts: 356
26 Nov 2017 05:20 PM
b1


Report Abuse
sweg2hipALT is not online. sweg2hipALT
Joined: 19 Sep 2017
Total Posts: 1
26 Nov 2017 05:27 PM
Got Discordee? add me: GodHOLINALILIUS#9156 lol ik.
Report Abuse
Jetskiis is online. Jetskiis
Joined: 17 Aug 2017
Total Posts: 356
26 Nov 2017 05:41 PM
? Why would we need to use#######d?
Report Abuse
Jetskiis is online. Jetskiis
Joined: 17 Aug 2017
Total Posts: 356
26 Nov 2017 05:57 PM
b


Report Abuse
Jetskiis is online. Jetskiis
Joined: 17 Aug 2017
Total Posts: 356
26 Nov 2017 06:40 PM
b1


Report Abuse
TheFatBurg3r is not online. TheFatBurg3r
Joined: 27 Dec 2011
Total Posts: 15
26 Nov 2017 06:50 PM
the handleKillCount function is inside the onHumanoidDied function


Report Abuse
Jetskiis is online. Jetskiis
Joined: 17 Aug 2017
Total Posts: 356
26 Nov 2017 06:59 PM
So I should just put it inside ?


Report Abuse
TheFatBurg3r is not online. TheFatBurg3r
Joined: 27 Dec 2011
Total Posts: 15
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 is online. Jetskiis
Joined: 17 Aug 2017
Total Posts: 356
26 Nov 2017 07:11 PM
The wipeouts are working but KO's arent :/


Report Abuse
TheFatBurg3r is not online. TheFatBurg3r
Joined: 27 Dec 2011
Total Posts: 15
26 Nov 2017 07:17 PM
getKillerOfHumanoidIfStillInGame()

may I see how this function works?


Report Abuse
Jetskiis is online. 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
Chronomaton is online. Chronomaton
Joined: 02 Feb 2012
Total Posts: 3461
26 Nov 2017 08:00 PM
######### # don't have BC, and yet I can still afford to get some ROBUX.
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