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

I need help with furnace script in tycoon. Ores aren't disappearing. What is wrong?

Asked by 5 years ago

I'm making a tycoon. I have 3 scripts: Furnace Script

function destroy(hit) 
    if hit.Name == "drop" then
        hit:Destroy()
    end
end

workspace.PartStorage.drop.Touched:connect(destroy)

Main Script

partStorage = Instance.new("Model", workspace)
partStorage.Name = "PartStorage"

Drop Script

wait(2)
workspace:WaitForChild("PartStorage")

while true do
    wait (1)
    local drop = Instance.new("Part", workspace.PartStorage)
    drop.Name = "drop"
    drop.Size = Vector3.new(1, 1, 1)
    drop.Position = script.Parent.Position
end

The problem is, that when I want to destroy ores, it's showing "drop is not a valid member of Model" in output. When I check "PartStorage" model, there are "drop" parts in it.

0
Are these all Server Scripts? SerpentineKing 3885 — 5y
0
.Touched only works when a player touches it, use :GetTouchingParts() and iterate it, and with that, then delete the part greatneil80 2647 — 5y
0
Greatneil80, can you show me an exemple how should I write it? emil88020 0 — 5y

Answer this question