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: How to do something if a player dies

Previous Thread :: Next Thread 
Weirdraidercs35 is not online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
12 Oct 2015 02:09 PM
x=0
y=0
player = script.Parent.Parent.Parent.Parent

x1=0
y1=0
player = script.Parent.Parent.Parent.Parent

local respawnDelay = 0
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
-- find the humanoid, and detect when it dies
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
humanoid.Died:connect(function()
wait(respawnDelay)
if player.Teams.TeamColor == BrickColor.new("Moss") then
x1=x1+1
end
if player.Teams.TeamColor == BrickColor.new("StormBlue")then
y1=y1+1
end
player:LoadCharacter()
end)
end
end)
player:LoadCharacter() -- load the character for the first time
end)

This doesn't work and I don't know why.
Report Abuse
Weirdraidercs35 is not online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
12 Oct 2015 02:57 PM
anyone ?
Report Abuse
InsaneDays is not online. InsaneDays
Joined: 28 Jan 2012
Total Posts: 762
12 Oct 2015 02:59 PM
local humanoid = character:WaitForChild("Humanoid")
Report Abuse
Weirdraidercs35 is not online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
12 Oct 2015 03:08 PM
it still doesn't work
Report Abuse
REAPERMOXXY is not online. REAPERMOXXY
Joined: 23 Jan 2014
Total Posts: 1831
12 Oct 2015 03:09 PM
Also,

BrickColor.new("StormBlue")then

is "Storm blue"

✗ ʙᴀᴢɪɴɢᴀ
Report Abuse
Weirdraidercs35 is not online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
12 Oct 2015 03:32 PM
It still doesn't work
Report Abuse
Weirdraidercs35 is not online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
12 Oct 2015 03:34 PM
I'm trying to increase the value of a varible whenever a player on a specific team dies.
Report Abuse
Weirdraidercs35 is not online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
12 Oct 2015 04:03 PM
bump
Report Abuse
Weirdraidercs35 is not online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
12 Oct 2015 04:21 PM
bump2
Report Abuse
IllegallyBlind is not online. IllegallyBlind
Joined: 07 Nov 2010
Total Posts: 1691
12 Oct 2015 04:22 PM
humanoid.Died:connect(function()


i make u math.sqrt()
Report Abuse
Weirdraidercs35 is not online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
12 Oct 2015 04:39 PM
I have that in my code but it won't work.
Report Abuse
Dogejia is not online. Dogejia
Joined: 08 Feb 2012
Total Posts: 1873
12 Oct 2015 04:59 PM
It does, its something else wrong


gcmi lg lpxtlc; Decode it with Vigenere Cipher, keyword is Doge, if you dare >:)
Report Abuse
Weirdraidercs35 is not online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
12 Oct 2015 05:11 PM
do you know whats wrong with it ?
Report Abuse
Dogejia is not online. Dogejia
Joined: 08 Feb 2012
Total Posts: 1873
12 Oct 2015 05:13 PM
No, I'll read it


gcmi lg lpxtlc; Decode it with Vigenere Cipher, keyword is Doge, if you dare >:)
Report Abuse
Weirdraidercs35 is not online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
12 Oct 2015 05:27 PM
did you find the problem ?
Report Abuse
Dogejia is not online. Dogejia
Joined: 08 Feb 2012
Total Posts: 1873
12 Oct 2015 05:50 PM
I'd assume something with the teams, also you loaded a character twice?


gcmi lg lpxtlc; Decode it with Vigenere Cipher, keyword is Doge, if you dare >:)
Report Abuse
Weirdraidercs35 is not online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
12 Oct 2015 06:06 PM
oh
Report Abuse
Weirdraidercs35 is not online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
12 Oct 2015 06:11 PM
how would you check what team someone is on then.
Report Abuse
Weirdraidercs35 is not online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
12 Oct 2015 06:12 PM
if player.Teams.TeamColor == BrickColor.new("Moss") then
x1=x1+1
end
Report Abuse
scottmike0 is not online. scottmike0
Joined: 14 Sep 2008
Total Posts: 1073
12 Oct 2015 06:14 PM
use x+=1
its better.
Report Abuse
SilentSippycup is not online. SilentSippycup
Joined: 22 Apr 2012
Total Posts: 1168
12 Oct 2015 06:14 PM
if player.TeamColor == BrickColor.new("Moss") then
x1=x1+1
end
Report Abuse
Weirdraidercs35 is not online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
12 Oct 2015 06:38 PM
i tried that.
Report Abuse
SilentSippycup is not online. SilentSippycup
Joined: 22 Apr 2012
Total Posts: 1168
12 Oct 2015 08:10 PM
then something else is wrong with it because thats how my scripts access teamcolor
Report Abuse
SilentSippycup is not online. SilentSippycup
Joined: 22 Apr 2012
Total Posts: 1168
12 Oct 2015 08:13 PM
are you sure "player = script.Parent.Parent.Parent.Parent" is correct? you can always call print(player.Name) to check. if thats right then you can try making a new player variable called like playerA and make it like this

playerA = game.Players:FindFirstChild(player.Name)

then try

if playerA.TeamColor == blabalbla end
Report Abuse
Weirdraidercs35 is not online. Weirdraidercs35
Joined: 14 May 2015
Total Posts: 2275
12 Oct 2015 08:14 PM
x=0
while true do
wait (0.2)
if player.Humanoid.Health <=0 and player.TeamColor == BrickColor.new("Storm Blue") then
x=x+1
end

end
Okey I made a new script but it doesn't work too.
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