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

"attempt to call a userdata value" Help please?

Asked by 9 years ago

Everytimes i touch my bomb, the output says : 18:34:38.972 - attempt to call a userdata value

Here is the code :

function Bomb(part)
    if part.Parent:FindFirstChild("Humanoid") then
        local BB = Instance.new("Explosion")
        BB.ExplosionType = Enum.ExplosionType.CratersAndDebris
        BB.Parent = workspace
        BB.BlastRadius = 20
        BB.Position = Vector3.new(Bomb.Position)
        BB.BlastPressure = 500000
        BB.Name = "Explosion, Bomb"
        BB.DestroyJointRadiusPercent = 0
    end
end
Bomb = game.Workspace.Bomb
Bomb.Touched:connect(Bomb)
0
Try parenting the explosion to the bomb. Spooce 78 — 9y
0
But the explosion would appear at random times, i'm trying to make it explode once you touch it.. Like when i place an explosion in the workspace, the explosion restarts at random moments loulou1112 35 — 9y
0
What line does it say there is an error on? ItsMeKlc 235 — 9y
0
It's not showing any line where there is an error loulou1112 35 — 9y

1 answer

Log in to vote
0
Answered by
ItsMeKlc 235 Moderation Voter
9 years ago
function Bomb(part)
    if part.Parent:FindFirstChild("Humanoid") then
        local BB = Instance.new("Explosion")
        BB.ExplosionType = Enum.ExplosionType.CratersAndDebris
        BB.Parent = workspace
        BB.BlastRadius = 20
        BB.Position = part.Position
        BB.BlastPressure = 500000
        BB.Name = "Explosion, Bomb"
        BB.DestroyJointRadiusPercent = 0
    end
end

game.Workspace.Bomb.Touched:connect(Bomb)

Ad

Answer this question