|
| 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 |
|
|
| |
|
|
| 12 Oct 2015 02:59 PM |
local humanoid = character:WaitForChild("Humanoid")
|
|
|
| Report Abuse |
|
|
| |
|
|
| 12 Oct 2015 03:09 PM |
Also,
BrickColor.new("StormBlue")then
is "Storm blue"
✗ ʙᴀᴢɪɴɢᴀ |
|
|
| Report Abuse |
|
|
| |
|
|
| 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 |
|
|
| |
|
| |
|
|
| 12 Oct 2015 04:22 PM |
humanoid.Died:connect(function()
i make u math.sqrt() |
|
|
| Report Abuse |
|
|
|
| 12 Oct 2015 04:39 PM |
| I have that in my code but it won't work. |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 12 Oct 2015 05:11 PM |
| do you know whats wrong with it ? |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 12 Oct 2015 05:27 PM |
| did you find the problem ? |
|
|
| Report Abuse |
|
|
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 |
|
|
| |
|
|
| 12 Oct 2015 06:11 PM |
| how would you check what team someone is on then. |
|
|
| Report Abuse |
|
|
|
| 12 Oct 2015 06:12 PM |
if player.Teams.TeamColor == BrickColor.new("Moss") then x1=x1+1 end |
|
|
| Report Abuse |
|
|
| |
|
|
| 12 Oct 2015 06:14 PM |
if player.TeamColor == BrickColor.new("Moss") then x1=x1+1 end |
|
|
| Report Abuse |
|
|
| |
|
|
| 12 Oct 2015 08:10 PM |
| then something else is wrong with it because thats how my scripts access teamcolor |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|