can someone help me make this?
this is the only thing i can do by myself
function onTouched(hit1) local torso1 = hit1.Parent:findFirstChild("Torso") if torso1~=nil then Y = game.Players:playerFromCharacter(hit1.Parent) if Y.TeamColor==BrickColor.new("Deep blue")then -- i dont know what to put here end end end
please help I am the worst scripter
QUICK TIP: A more efficient way of doing your script would be to check for the player straight away.
CODE:
-- Script is inside the part that gets touched local color = BrickColor.new("Deep blue") script.Parent.Touched:connect(function(hit) local p = game.Players:GetPlayerFromCharacter(hit.Parent) if p then if p.TeamColor == color then local tool = hit.Parent:FindFirstChild("ToolName") -- or, p.Backpack:FindFirstChild("ToolName"), so you can disable it even if it's unequipped if tool then tool.Enabled = false end end end end)