So I made a system where if you touch a block it will teleport you to another part, but the problem is that I keep getting these mass errors that spam the output “Character is not a valid member of “MeshPart””
Touched returns the part that touched something, not the player
You need to make code that works for that, soemthing like this
script.Parent.Touched:Connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent) and hit.Parent.Humanoid.Health ~= 0 then --If Parent of the hit part is a player and is alive
hit.Parent.HumanoidRootPart.CFrame = game.Workspace.Buildings.JerryDeli.TPPart2.CFrame
end
end)
Anytime! Just remember to do a condition to check if the part belongs to a player/npc so it will work! If you have anymoer issues don’t be afraid to make another post!