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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 26 Jun 2017 |
| Total Posts: 7906 |
|
| |
|
PGFX
|
  |
| Joined: 26 Jun 2017 |
| Total Posts: 7906 |
|
| |
|
PGFX
|
  |
| Joined: 26 Jun 2017 |
| Total Posts: 7906 |
|
| |
|
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
|
  |
| 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 |
|
|
|
| 17 Oct 2017 05:23 PM |
money is money fam
#code error("you're*") |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 17 Oct 2017 05:26 PM |
| R u using global, local or module script |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 26 Jun 2017 |
| Total Posts: 7906 |
|
| |
|
seshimazi
|
  |
| Joined: 03 Jun 2007 |
| Total Posts: 177 |
|
| |
|
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 |
|
|