01 | mouse.Button 1 Down:Connect( function () |
02 | if mouse.Target.Parent:FindFirstChild( "Humanoid" ) then |
03 | local arrestee = mouse.Target.Parent |
04 | print (arrestee) |
05 | local arrested = game.Players [ arrestee ] |
06 | if arrested [ "TeamColor" ] = = BrickColor.new( "Teal" ) or arrested [ "Settings" ] .innocent.Value = = true then |
07 | print ( "innocent" ) |
08 | else |
09 | game.ReplicatedStorage.Arrest:FireServer(arrestee) |
10 | end |
11 | end |
12 | end ) |
I am trying to us arrestee as a string, anyway to do that?
Edit: I solved the issue by putting the team checker part to a script:
1 | if mouse.Target.Parent:FindFirstChild( "Humanoid" ) then |
2 | local arrestee = mouse.Target.Parent |
3 | print (arrestee) |
4 | game.ReplicatedStorage.Arrest:FireServer(arrestee) |
you would use .Name
01 | mouse.Button 1 Down:Connect( function () |
02 | if mouse.Target.Parent:FindFirstChild( "Humanoid" ) then |
03 | local arrestee = mouse.Target.Parent |
04 | print (arrestee.Name) |
05 | local arrested = game.Players [ arrestee.Name ] |
06 | if arrested [ "TeamColor" ] = = BrickColor.new( "Teal" ) or arrested [ "Settings" ] .innocent.Value = = true then |
07 | print ( "innocent" ) |
08 | else |
09 | game.ReplicatedStorage.Arrest:FireServer(arrestee) |
10 | end |
11 | end |
12 | end ) |