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

I don't know how to fix the unknown statement, or what to use?

Asked by 4 years ago
if script.Parent.onPartTouched(otherPart)
    then
    print(part.Name .. " has touched")
    end

    part.Touched:Connect(onPartTouched)

I want to make an if statement on a collision code. It saying that it is unknown on the "onPartTouched" and "otherPart" it is saying that it is unknown. I don't know how to fix that. Thanks!!!

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Collision is put simply: Simple What I spot that could fix this, is a function:

script.Parent.Touched:Connect(function(hit)
    local name = hit.Name
    print(name .. " has touched " .. script.Parent.Name)
end)

Hope that helps, if not feel free to reply.

Ad

Answer this question