The script below is a script that is a child of a tool. It is supposed to show who is friend or foe by changing the mouse icon whenever you are hovering your mouse over somebody. Right now, It can only find out who is a friend by finding the torso color of who the mouse is hovering above. I want it to find out who is friend or foe by finding out their team color so that whoever is on your team is a friend and whoever is on the opposite team is a foe. I have tried changing local torso to hit.Parent.TeamColor and remove BrickColor but that didn't work. I am not good at scripting.
So please make it find friend or foe by finding their team color not torso brick color! Thanks! :D
bin = script.Parent
normal = "http://www.roblox.com/asset/?id=something1"
friendly = "http://www.roblox.com/asset/?id=something2"
enemy = "http://www.roblox.com/asset/?id=something3"
function Run(mouse)
mouse.Icon = normal
local hit = mouse.Target
if (hit == nil) then return end
local h = hit.Parent:FindFirstChild("Humanoid")
if h ~= nil then
local torso = hit.Parent.torso
if torso ~= nil then
if h.Health > 0 then
if (torso.BrickColor == bin.Parent.Torso.BrickColor) then
mouse.Icon = friendly
elseif torso.BrickColor ~= bin.Parent.Torso.BrickColor then
mouse.Icon = enemy
end
end
end
end
end

2 comments
did you attempt it at least?
I said in the post ' I have tried changing local torso to hit.Parent.TeamColor and remove BrickColor but that didn't work.'