Tool doesn't detect model i specified

  1. What do you want to achieve?
    I want a tool to detect the model that i specified.

  2. What is the issue?
    It doesn’t detect it at all. I made it work once but i can no longer replicate it.

local Pizza = script.Parent.Handle

local player = game.Players.LocalPlayer

local character = player.Character

local Delivery = game.ReplicatedStorage.Deliverys.TestBasic1 -- Change to the delivery spot name (Exact.)

Pizza.Touched:Connect(function(hit)

if hit.Name == "TestBasic1" then -- Change to the delivery spot name (Exact.)

print("Delivered")

end

end)

script.Parent.Equipped:Connect(function()

Delivery.Part.BillboardGui.Enabled = true

Delivery.Parent = workspace

end)

script.Parent.Unequipped:Connect(function()

Delivery.Part.BillboardGui.Enabled = false

end)

If it’s a model and not just a part, you should type:

if hit.Parent.Name == "TestBasic1" then
    print("Delivered")
end

Because the Touched event detects what is inside the model, not the model itself.

1 Like

Thank you, it worked. Forgot that i’d need to specify that its a parent.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.