This script is inside a block.
When I click on the block with a tool it fires to server and makes the block start getting more transparent and then it's transparency ends at 1 and turns CanCollide off.
This script is inside the block and detects when the block changes transparency, and when it's at 1 it clones a bone from replicated storage to the block... But it clones twice and idk why
boneType = script.Parent.Name
debounce = false
script.Parent.Changed:Connect(function()
if not debounce then
debounce = true
if script.Parent.Transparency == 1 then
local newBone = game.ReplicatedStorage[boneType]:Clone()
newBone.Position = script.Parent.Position
newBone.Anchored = false
newBone.Parent = game.Workspace.Bones
print("clone")
end
debounce = false
end
end)

1 comment
Yes it worked! Thanks so much.