local part = script.Parent part.Touched:connect(function(hit) if hit.Parent then local hum = hit.Parent:FindFirstChild("Humanoid") if hum then local player = game.Players:GetPlayerFromCharacter(hum) player.Parent.TeamColor = BrickColor.palette("Fossil") end end end)
Title is self-explanatory.
Here you go
local part = script.Parent part.Touched:connect(function(hit) local parent = hit.Parent --the part that touched parent if game.Players:GetPlayerFromCharacter(parent) then --If player local player = game.Players:FindFirstChild(parent.Name)--Finds player player.TeamColor = BrickColor.new("Fossil")--Team color end end)