How To Make Landmine That You Can Place Down

Scripting Tutorial #1

I Am Going To Show You How To Make A Landmine

Lets Begin!

Alright So Lets Begin By Making Our Landmine.

image

I Have made A Basic Landmine, Just For The Tutorial.

So When You Have Made Your Landmine, Dont Group It. Select All The Parts For Your Landmine And Turn It Into A Union. Then Rename It To “Handle”. Dont Anchor It.

image

When You Have Done That, Insert a Tool. Rename it To “Landmine” Then Put Your Landmine (Handle) Into The tool

image

Add a Script Into The Handle And Rename it to “ExplodeOnTouch”.

image

Then Insert This Script:

        local debounce = false
script.Parent.Touched:Connect(function(hit)
if hit.Anchored == false then
	debounce = true
	local explosion = Instance.new("Explosion", workspace)
	explosion.Position = script.Parent.Position + Vector3.new(0, 0.6, 0)
	explosion.ExplosionType = Enum.ExplosionType.NoCraters
	explosion.BlastRadius = 4
	explosion.BlastPressure = 12500
	wait(0.2)
	script.Parent:Destroy()
end
end)

Now That You Have Done That, Lets add A Script Into The Landmine And Rename To “ToolFunction”.

image

Then Insert This Script Into The ToolFunction Script.

local debounce = false
script.Parent.Activated:Connect(function()
if debounce == false then
	debounce = true
	local clone = script.Parent.Handle:Clone()
	clone.Parent = workspace
	clone.Name = "prop.Landmine"
	clone.Velocity = Vector3.new(0,0,0)
	clone.CanCollide = true
	script.Parent.Parent = nil

end
end)

Were All Done, Although We Should Add A Beeping Noise Before The Explosion When Someone Triggers it.

So Insert A Sound Into Handle, Then Rename it To Beep.

image

Now We Need to Find A Beep Noise.

I Have Found a Really Good Beep Noise And Credits to @Jenrak For Making This Beep.

In The Properties Of Your Sound, Please Have The Same Properties as Me.
image
image

Now That We Have the Beep Noise, We Need It To Play When A Player Touches The Landmine. So We have to edit The ToolFunction Script.

Here Is The Edit For The ToolFunction Script:

local debounce = false
script.Parent.Activated:Connect(function()
if debounce == false then
	debounce = true
	local clone = script.Parent.Handle:Clone()
	clone.Parent = workspace
	clone.Name = "prop.Landmine"
	clone.Velocity = Vector3.new(0,0,0)
	clone.CanCollide = true
	script.Parent.Parent = nil
wait(0.7)
	clone.ExplodeOnTouch.Disabled = false
	clone.Beep:Play()
wait(0.3)
	clone.Beep:Play()
end
end)

When You Have Finished, Put Your Landmine In The StarterPack. And You Should Be Able To Place It Down And also Blow Up When a Player Steps On It.

If There Are Any Issues You Can Contact Me On Discord (Cup#7777)

See It In Action!!
robloxapp-20200814-2019071.wmv (4.2 MB)

I Had Alot Of Trouble Trying To Make The Landmine Face Straight Up When Its being Held. So You Can Try for Yourself.

Model

What Tutorial Should I Do On Next??

  • How To Make A Jetpack
  • How To Make a Plane
  • How To Make a Premium Only Door
  • How to An FPS Counter
  • How To Make a Backpack System

0 voters

34 Likes

Pretty interesting and neat tutorial. Thanks!

2 Likes

A fairly useful, orderly and understandable tutorial
Thanks for teaching me
I appreciate it and hopefully I get another tutorial of whatever

3 Likes

The Pole Will Be Opened For 2 Hours.

1 Like

This is VERY useful!! I am super happy you created this, it’ll come in handy in a couple of game ideas I had.

3 Likes

Im thinking of a realistic plane system with aerodynamics and all of that, would be cool.

holly guacamole , I just voted and replied to the dude, and now see this is 2 years old! sweet! fyi I voted for backpack system