1 | scoreevent.OnClientEvent:connect( function (...) |
2 | local tuple = { ... } |
3 | if tuple [ 1 ] = = "Deathmatch" then |
4 | print (tuple [ 2 ] ) |
5 | if tuple [ 2 ] = = "Really blue" then |
6 | print ( "1" ) |
7 | end |
8 | end |
9 | end ) |
For some reason where it has print(tuple[2]) it prints "Really blue", but when it asks if tuple[2] == "Really blue" then it doesn't print("1"), and I can't get why. Please help.
01 | function newcharacter(murderedplayer, character) |
02 | local humanoid = character:FindFirstChild( "Humanoid" ) |
03 | if humanoid then |
04 | humanoid.Died:connect( function () |
05 | if character.Humanoid:FindFirstChild( "creator" ) then |
06 | local tag = character.Humanoid.creator |
07 | local killer = tag.Value |
08 | scoreevent:FireAllClients( "Deathmatch" , killer:WaitForChild( "PlayerStats" ).Team.Value) |
09 | end |
10 | end ) |
11 | end |
12 | end |
From what I understood, that value is a BrickColor value, thus tuple[2]
will not be the string "Really blue", but the BrickColor "Really blue". When you print
it, the internal print
function will call tostring
on it, and print the string "Really blue", but when you compare the BrickColor with the string, it is not the same.
So, instead of:
1 | if tuple [ 2 ] = = "Really blue" then |
You can use:
1 | if tuple [ 2 ] = = BrickColor.new( "Really blue" ) then |
Hope it helps! :) Please comment if you don't understand.