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: Points..

Previous Thread :: Next Thread 
18lpickett is not online. 18lpickett
Joined: 15 Jul 2012
Total Posts: 3121
21 Jun 2014 05:35 PM
Why doesnt this script add points when the Player on Humans kills and player on Zombies? Nothing shows up in output

local KillCount =(function(Humanoid,Player)
local Killer = GetKiller(Humanoid)
if (Killer) then
local Stats = Killer:FindFirstChild('leaderstats')
if (Stats) then
local Points = Stats:FindFirstChild('Points')
local Dead = Killer:FindFirstChild('Dead')
if Killer ~= Player then
if not (Dead.Value) then
Points.Value = Points.Value + 30
else
Points.Value = Points.Value + 30
end
else
Points.Value = Points.Value
end
end
end
end)
Report Abuse
Iluvt0trolly0y is not online. Iluvt0trolly0y
Joined: 14 Jun 2014
Total Posts: 37
21 Jun 2014 05:37 PM
you cant call a function in a variable
Report Abuse
Vuva is not online. Vuva
Joined: 22 Jan 2010
Total Posts: 1102
21 Jun 2014 05:37 PM
If there are no errors showing up then my guess is that one of the if statements are not passing as true.
Report Abuse
18lpickett is not online. 18lpickett
Joined: 15 Jul 2012
Total Posts: 3121
21 Jun 2014 05:40 PM
this is the full script. The script is called LeaderBoard.
Report Abuse
18lpickett is not online. 18lpickett
Joined: 15 Jul 2012
Total Posts: 3121
21 Jun 2014 05:41 PM
local UnDead = Game.Lighting:FindFirstChild('Zombies')
local Playing = Game.Workspace:FindFirstChild('Playing')
local Stage = Game.Workspace:FindFirstChild('Stage')
local Weapon = Game.Lighting:FindFirstChild('Pistol(Lvl 1 Free)')
local Humans = Game:FindFirstChild('Humans')
local Zombies = Game.Teams:FindFirstChild('Zombies')

local RemoveHint =(function(Player)
if (Player and Player.PlayerGui:FindFirstChild('Leader Hint')) then
Player.PlayerGui['Leader Hint']:remove()
end
end)

local ShowHint =(function(GameText,Player)
RemoveHint(Player)
local Message = Instance.new('Hint')
Message.Name = 'Leader Hint'
Message.Text = GameText
Message.Parent = Player.PlayerGui
end)

local RemoveMessage =(function(Player)
if (Player and Player.PlayerGui:FindFirstChild('Leader Message')) then
Player.PlayerGui['Leader Message']:remove()
end
end)

local ShowMessage =(function(GameText,Player)
RemoveMessage(Player)
local Message = Instance.new('Message')
Message.Name = 'Leader Message'
Message.Text = GameText
Message.Parent = Player.PlayerGui
end)

local RemoveFumeMessage =(function(Player)
if (Player and Player.PlayerGui:FindFirstChild('Fume Message')) then
Player.PlayerGui['Fume Message']:remove()
end
end)

local MakeZombie =(function(Zom, Player)
local vUnDead = Zom['ZAnimate']:Clone()
vUnDead.Disabled = false
Wait(0)
local Character = Player.Character
Character['Sound']:remove()
Character['Animate']:remove()
Wait(0)
vUnDead.Parent = Character
Character['creator'].Value = Player
end)

local GetKiller =(function(Humanoid)
local Tag = Humanoid:FindFirstChild('creator')
if (Tag) then
local Killer = Tag.Value
if (Killer.Parent) then
return Killer
end
end
return nil
end)

local KillCount =(function(Humanoid,Player)
local Killer = GetKiller(Humanoid)
if (Killer) then
local Stats = Killer:FindFirstChild('leaderstats')
if (Stats) then
local Points = Stats:FindFirstChild('Points')
local Dead = Killer:FindFirstChild('Dead')
if Killer ~= Player then
if not (Dead.Value) then
Points.Value = Points.Value + 30
else
Points.Value = Points.Value + 30
end
else
Points.Value = Points.Value
end
end
end
end)

local HumanoidDied =(function(Humanoid,Player)
local Stats = Player:FindFirstChild('leaderstats')
if (Stats) then
local Dead = Player:FindFirstChild('Dead')
Dead.Value = true
Player.TeamColor = Zombies.TeamColor
RemoveFumeMessage(Player)
local Killer = GetKiller(Humanoid)
KillCount(Humanoid,Player)
end
end)

local PlayerRespawn =(function(Prop,Player)
if (Prop == 'Character') then
if (Player.Character and Player.Character.Name == Player.Name) then
local Stats = Player:FindFirstChild('leaderstats')
if Stats ~= nil then
local Dead = Player:FindFirstChild('Dead')
local Class = Player:FindFirstChild('Class')
if (Dead.Value) then
Wait(1)
if (Player) and (Player.Character) then
MakeZombie(UnDead[Class.Value],Player)
else
return
end
end
end
Humanoid = Player.Character['Humanoid']
Humanoid.Died:connect(function()
HumanoidDied(Humanoid,Player)
end)
end
end
end)

Game.Players.PlayerAdded:connect(function(Player)
while true do
if (Player.Character) then
break
end
Wait(1)
end
local Stats = Instance.new('IntValue',Player)
Stats.Name = 'leaderstats'
local Points = Instance.new('IntValue',Stats)
Points.Name = 'Points'
Points.Value = 0
local Dead = Instance.new('BoolValue',Player)
Dead.Name = 'Dead'
Dead.Value = false
local Class = Instance.new('StringValue',Player)
Class.Name = 'Class'
Class.Value = 'Zombie'
if (Playing.Value) then
Weapon:Clone().Parent = Player.Backpack
end
local Humanoid = Player.Character:FindFirstChild('Humanoid')
Humanoid.Died:connect(function()
HumanoidDied(Humanoid,Player)
end)
Player.Changed:connect(function(Prop)
PlayerRespawn(Prop,Player)
end)
Player.Chatted:connect(function(Message,Recipient)
local Class = Player:FindFirstChild('Class')
if not (Class) then
return
end
Message = string.lower(Message)
if (Message == '/zombie') then
Class.Value = 'Zombie'
elseif (Message == '/fastzombie') then
if (Stage.Value >= 2) then
Class.Value = 'Fast Zombie'
else
ShowMessage('Fast Zombie is not unlocked!',Player)
Wait(3)
RemoveMessage(Player)
end
elseif (Message == '/kamizombie') then
if (Stage.Value >= 3) then
Class.Value = 'Kami-Zombie'
else
ShowMessage('Kami-Zombie is not unlocked!',Player)
Wait(3)
RemoveMessage(Player)
end
elseif (Message=='/ghostzombie') then
if (Stage.Value >= 4) then
Class.Value = 'Ghost Zombie'
else
ShowMessage('Ghost Zombie is not unlocked!',Player)
Wait(3)
RemoveMessage(Player)
end
elseif (Message == '/fastghostzombie') then
if (Stage.Value >= 5) then
Class.Value = 'Fast Ghost Zombie'
else
ShowMessage('Fast Ghost Zombie is not unlocked!',Player)
Wait(3)
RemoveMessage(Player)
end
elseif (Message == '/zombieboss') then
if (Stage.Value >= 6) then
Class.Value = 'Zombie Boss'
else
ShowMessage('Zombie Boss! is not unlocked!',Player)
Wait(3)
RemoveMessage(Player)
end
end
end)
end)
Report Abuse
18lpickett is not online. 18lpickett
Joined: 15 Jul 2012
Total Posts: 3121
21 Jun 2014 05:45 PM
B1
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