So, I'm fiddling around with making scripts from scratch. I've made this one script, where if you touch the part, an explosion instance is made in the part. Here's the code:
local part = game.Worspace.Boom
local db = false
function Boom(hit)
local human = hit.Parent:FindFirstChild("Humanoid")
local explosion = Instance.new("Explosion", game.Workspace)
if not db then
if human then
db = true
wait(2)
explosion.Position = part.Position
wait(2)
db = false
end
end
end
part.Touched:connect(Boom)
I'm not sure why it doesn't work. Output says "Touched is not a valid member of Workspace" and " Workspace is not a valid member of datamodel". Any suggestions?

2 comments
Oh my gosh. I'm so stupid. My apologies. I should have noticed that. Thanks!
@Peeshavee It's okay, I make errors like that all the time XD