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 » Scripting Helpers
Home Search
 

Re: Wo/Ko/Rank/Cash leaderboard not working

Previous Thread :: Next Thread 
DeathByChina is not online. DeathByChina
Joined: 26 Apr 2010
Total Posts: 515
19 Nov 2013 12:31 PM
kills.Name = "KOs"
kills.Value = 0
local deaths = Instance.new("IntValue")
deaths.Name = "Wipeouts"
deaths.Value = 0
kills.Parent = stats
deaths.Parent = stats
local cash = Instance.new("IntValue")
cash.Name = "Credits"
cash.Value = 10
while true do
if newPlayer.Character ~= nil then break end
wait(5)
end
table.insert(Adders,cash)
stats.Parent = newPlayer
end
function Add()
players = game.Players:GetChildren()
for i=1, #players do
if (players[i]:findFirstChild("leaderstats")) then
if (players[i]:IsInGroup(782871)==true) then -----This group will Recieve Bonus cash
players[i].leaderstats.Credits.Value = players[i].leaderstats.Credits.Value + 26
else
players[i].leaderstats.Credits.Value = players[i].leaderstats.Credits.Value + 13
end
end
end
end


game.Players.ChildAdded:connect(onPlayerEntered)

while true do
wait(70)
Add()
end
local humanoid = newPlayer.Character.Humanoid
humanoid.Died:connect(function() onHumanoidDied(humanoid, newPlayer) end )
newPlayer.Changed:connect(function(property) onPlayerRespawn(property, newPlayer) end )
stats.Parent = newPlayer
function Send_DB_Event_Died(victim, killer)
local killername = "no one"
if killer ~= nil then killername = killer.Name end
if shared["deaths"] ~= nil then
shared["deaths"](victim, killer)
end
end
function Send_DB_Event_Kill(killer, victim)
if shared["kills"] ~= nil then
shared["kills"](killer, victim)
end
end
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)
Send_DB_Event_Died(player, killer)
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)
local tag = humanoid:findFirstChild("creator")
if tag ~= nil then
local killer = tag.Value
if killer.Parent ~= nil then
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
Send_DB_Event_Kill(killer, player)
end
end
end
game.Players.ChildAdded:connect(onPlayerEntered)


Mind showing me what I did wrong and help me fix it >_<
Report Abuse
odedelisha is not online. odedelisha
Joined: 31 Dec 2010
Total Posts: 3020
19 Nov 2013 12:34 PM
Can you specify the problem?
Report Abuse
DeathByChina is not online. DeathByChina
Joined: 26 Apr 2010
Total Posts: 515
19 Nov 2013 12:35 PM
Well that is the problem I don't what's wrong with it lol.Leaderboard won't show up,nothing besides my team names show up and I have the rank script for the rank part of the leaderboard to detect ranks.
Report Abuse
breuning is not online. breuning
Joined: 30 Oct 2008
Total Posts: 4268
19 Nov 2013 12:37 PM
output please
Report Abuse
DeathByChina is not online. DeathByChina
Joined: 26 Apr 2010
Total Posts: 515
19 Nov 2013 12:38 PM
Okay 1 second.
Report Abuse
odedelisha is not online. odedelisha
Joined: 31 Dec 2010
Total Posts: 3020
19 Nov 2013 12:38 PM
People could see the problem clearly and see if other things are set alright if they had the game.
Report Abuse
DeathByChina is not online. DeathByChina
Joined: 26 Apr 2010
Total Posts: 515
19 Nov 2013 12:41 PM
Oded you just want my script. bruen I forgot how to use output >_<, Studio then test mode?
Report Abuse
odedelisha is not online. odedelisha
Joined: 31 Dec 2010
Total Posts: 3020
19 Nov 2013 12:45 PM
DeathByChina, I don't.
I can't even fix it, I'm just saying.
Report Abuse
odedelisha is not online. odedelisha
Joined: 31 Dec 2010
Total Posts: 3020
19 Nov 2013 12:46 PM
MainBar > View > Output Window
Report Abuse
DeathByChina is not online. DeathByChina
Joined: 26 Apr 2010
Total Posts: 515
21 Nov 2013 01:49 PM
B1
Report Abuse
DeathByChina is not online. DeathByChina
Joined: 26 Apr 2010
Total Posts: 515
21 Nov 2013 06:46 PM
B2
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Nov 2013 06:47 PM
Test in Start Server->Start Player
and in the server window, click view->output
And post any "red" you see
Report Abuse
DeathByChina is not online. DeathByChina
Joined: 26 Apr 2010
Total Posts: 515
21 Nov 2013 06:52 PM
Tried got nothing. All was good, I think I don't have everything in right spot.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
21 Nov 2013 06:54 PM
So the problem is only certain players show up on the leaderboard?
Do the values work themselves?
(Make sure you aren't testing in Play Solo)
Report Abuse
DeathByChina is not online. DeathByChina
Joined: 26 Apr 2010
Total Posts: 515
21 Nov 2013 06:55 PM
Oh I think I tested in play solo.
Report Abuse
DeathByChina is not online. DeathByChina
Joined: 26 Apr 2010
Total Posts: 515
21 Nov 2013 07:09 PM
There is no errors for the script.
Report Abuse
DeathByChina is not online. DeathByChina
Joined: 26 Apr 2010
Total Posts: 515
22 Nov 2013 12:06 PM
B3
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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