I was making a bomb script, and when I went to test it out it printed this error:
Equipped is not a valid member of Workspace "Workspace" -- Line 36
Here’s the script:
local tool = script.Parent.Parent
local handle = script.Parent
local debounce = false
local EMIT_AMOUNT = 3
function onActivated()
if not debounce then
debounce = true
local bomb = handle:Clone()
bomb.Parent = workspace
bomb.Position = handle.Position
bomb.CanCollide = true
handle.Transparency = 1
bomb["Bomb Fuse"]:play();
delay(3,function()
bomb["Bomb Fuse"]:stop();
bomb["Bomb Explosion 1"]:play();
local exp = Instance.new("Explosion",workspace)
exp.Position = bomb.Position
exp.BlastRadius = 10
exp.BlastPressure = 10000
bomb.Attachment.orange:Emit(EMIT_AMOUNT)
bomb.Attachment.shockwave:Emit(EMIT_AMOUNT)
bomb.Attachment.smoke:Emit(EMIT_AMOUNT)
bomb:Destroy()
end)
end
wait(7)
handle.Transparency = 0
debounce = false
end
function onEquipped()
handle.bomb_pickup:play();
end
print(tool)
--[[line 36]] tool.Equipped:Connect(onEquipped)
tool.Activated:Connect(onActivated)