mouse.Button1Down:Connect(function() if mouse.Target.Parent:FindFirstChild("Humanoid") then local arrestee = mouse.Target.Parent print(arrestee) local arrested = game.Players[arrestee] if arrested["TeamColor"] == BrickColor.new("Teal") or arrested["Settings"].innocent.Value == true then print("innocent") else game.ReplicatedStorage.Arrest:FireServer(arrestee) end end 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:
if mouse.Target.Parent:FindFirstChild("Humanoid") then local arrestee = mouse.Target.Parent print(arrestee) game.ReplicatedStorage.Arrest:FireServer(arrestee)
you would use .Name
mouse.Button1Down:Connect(function() if mouse.Target.Parent:FindFirstChild("Humanoid") then local arrestee = mouse.Target.Parent print(arrestee.Name) local arrested = game.Players[arrestee.Name] if arrested["TeamColor"] == BrickColor.new("Teal") or arrested["Settings"].innocent.Value == true then print("innocent") else game.ReplicatedStorage.Arrest:FireServer(arrestee) end end end)