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: Leader board Script Problem (10 robux to whoever helps)

Previous Thread :: Next Thread 
PGFX is online. PGFX
Joined: 26 Jun 2017
Total Posts: 7906
17 Oct 2017 04:55 PM
So basically, when a user kills someone in a game, it gives the user who died 2 deaths and the user who ###### #### nothing. I want it to give the user 1 kill and the other 1 death but it's just not working. This script came with Zednov's tycoon kit and it's not working. I will give 10 robux to whoever helps me solve this issue!

Also, notice that the script was disorganized when I copy and pasted. It's not my fault. :)

Script:

local Settings = require(script.Parent.Settings)
script.Parent = game.ServerScriptService
stands = {}
CTF_mode = false

function onHumanoidDied(humanoid, player)
local stats = player:findFirstChild("leaderstats")
if stats ~= nil then
local deaths = stats:findFirstChild(Settings.LeaderboardSettings.DeathsName)
if deaths then
deaths.Value = deaths.Value + 1
end
-- do short dance to try and find the killer
if Settings.LeaderboardSettings.KOs then
local killer = getKillerOfHumanoidIfStillInGame(humanoid)
handleKillCount(humanoid, player)
end
end
end

function onPlayerRespawn(property, player)
-- need to connect to new humanoid
if property == "Character" and player.Character ~= nil then
local humanoid = player.Character.Humanoid
local p = player
local h = humanoid
if Settings.LeaderboardSettings.WOs then
humanoid.Died:connect(function() onHumanoidDied(h, p) end )
end
end
end

function getKillerOfHumanoidIfStillInGame(humanoid)
-- returns the player object that killed this humanoid
-- returns nil if the killer is no longer in the game

-- 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(Settings.LeaderboardSettings.KillsNames)
if kills then
if killer ~= player then
kills.Value = kills.Value + 1
else
kills.Value = kills.Value - 1
end
else
return
end
end
end
end
Report Abuse
PGFX is online. PGFX
Joined: 26 Jun 2017
Total Posts: 7906
17 Oct 2017 04:57 PM
If someone could please post the corrected, proper script below, that would be great! Your reward will be 10 robux! Thanks!
Report Abuse
PGFX is online. PGFX
Joined: 26 Jun 2017
Total Posts: 7906
17 Oct 2017 04:59 PM
If you notice, it shows a "1" in the proper spot of the script. I don't understand why it's wrong. Please someone help!
Report Abuse
PGFX is online. PGFX
Joined: 26 Jun 2017
Total Posts: 7906
17 Oct 2017 05:00 PM
Bump
Report Abuse
PGFX is online. PGFX
Joined: 26 Jun 2017
Total Posts: 7906
17 Oct 2017 05:02 PM
1
Report Abuse
PGFX is online. PGFX
Joined: 26 Jun 2017
Total Posts: 7906
17 Oct 2017 05:20 PM
2
Report Abuse
PGFX is online. PGFX
Joined: 26 Jun 2017
Total Posts: 7906
17 Oct 2017 05:22 PM
I was really hoping to get help on this issue
Report Abuse
LaeMVP is online. LaeMVP
Joined: 24 Jun 2013
Total Posts: 4416
17 Oct 2017 05:22 PM
you're asking us to fix a freemodel for 10 robux
Report Abuse
gohan31865 is not online. gohan31865
Joined: 30 Jan 2011
Total Posts: 895
17 Oct 2017 05:23 PM
money is money fam


#code error("you're*")
Report Abuse
LaeMVP is online. LaeMVP
Joined: 24 Jun 2013
Total Posts: 4416
17 Oct 2017 05:25 PM
whomsts time is worth 10 robux, mine is worth more
Report Abuse
musickman14 is not online. musickman14
Joined: 27 Nov 2011
Total Posts: 979
17 Oct 2017 05:26 PM
R u using global, local or module script
Report Abuse
PGFX is online. PGFX
Joined: 26 Jun 2017
Total Posts: 7906
17 Oct 2017 07:48 PM
music

I'm not for sure what you mean by that. This script is from zednov's tycoon kit.
Report Abuse
PGFX is online. PGFX
Joined: 26 Jun 2017
Total Posts: 7906
17 Oct 2017 07:53 PM
bump
Report Abuse
seshimazi is not online. seshimazi
Joined: 03 Jun 2007
Total Posts: 177
17 Oct 2017 08:08 PM
Global Or Local Script?


Report Abuse
PGFX is online. PGFX
Joined: 26 Jun 2017
Total Posts: 7906
18 Oct 2017 07:01 AM
How do I decipher between a global, local, or modular script?
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