So I have a supply drop model that is supposed to change it's position when a button is pressed so it can fall and a player can use it. It gets taken from replicated storage where it can then be clones and set in the sky above the map. When the model falls to the ground and player clicks on it, the whole model gets destroyed and they are given tools. This works fine the first button press but when it's pressed for a second time the model won't appear. Any help? The code to clone it is inside a script which is inside the button.
local MedDrop = game.ReplicatedStorage.FallingMedBox:Clone()
debounce = true
script.Parent.ClickDetector.MouseClick:Connect(function()
if debounce == true then
debounce = false
MedDrop.Parent = game.Workspace
MedDrop:SetPrimaryPartCFrame(CFrame.new(-158, 202.5, 240))
wait(1)
debounce = true
end
end)

1 comment
Oh thanks so much! Never even though of putting it all inside of the clickdetector.