Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Detect if a player touches a mesh, rather than the part itself?

Asked by
TopDev 0
9 years ago

I'm making a tool, It uses a part, which is very small, and a special mesh which grows. When the Mesh touches the player, it will kill them. If anyone knows how to detect if a player touches a mesh itself, and not the part, and could help me I'd appreciate it.

1 answer

Log in to vote
0
Answered by 9 years ago
script.Parent.Touched:connect(function(hit)
    local hum = hit.Parent:FindFirstChild("Humanoid")
    if hum then
    hum.Health = hum.Health - hum.MaxHealth
    script.Parent.MeshName.Size = script.Parent.MeshName.Size + Vector3.new(x,y,z)
    end
end)

It's impossible, as far as I know, to tell if someone touches a mesh. You could make the parts size equal the mesh's size? Other than that I'm thinking you're out of luck. Like I said, make the parts size == mesh's size

--Put this in another script inside the handle
while wait() do
    script.Parent.Size = Mesh'sLocation.Size
end
0
Can't do that, I forgot to mention that the part is welded, changing the size will break the weld. TopDev 0 — 9y
Ad

Answer this question