Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Need help ASAP Script won't work keep saying error and crashing why? (Read desc)

My other question got removed by a mod for some reason.But, thank you to the guy/girl who helped me with this script sorry for reposting this. I hope you don't get mad at me. But, anyways I was trying to do is when the player press the button the tree explodes into pieces. Here's the script.

function onClicked(playerWhoClicked)
    workspace["Tree"]:explode()
end
script.Parent.ClickDetector.MouseClick:Connect(onClicked)

1 answer

function onClicked(playerWhoClicked)
    local t = workspace:FindFirstChild("Tree")
    t:Destroy() 
end
script.Parent.ClickDetector.MouseClick:Connect(onClicked)
-- if your trying to remove it.



function onClicked(playerWhoClicked)
    local t = workspace:FindFirstChild("Tree")
    local ex = Instance.new("Explosion")
   ex.Parent = t
end
script.Parent.ClickDetector.MouseClick:Connect(onClicked)
-- to explode

2 comments

0

Thanks

0

It didn't work.

This discussion is preserved as it was. New answers, comments, and votes are closed.