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)

6 comments
It didnt work
What error did you get?
Unable to cast value to object
What line?
Still gonna accept your answer since it solved the problem on my other script and you are the only one helped
5th line and 6th line