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

How do i make a explosion script in the gear after 2.70 seconds of gear equipped?

heres what i want it to be

https://youtu.be/-FPdkbvs4KM

heres the code

local Tool = script.Parent;

enabled = true

function onActivated() if not enabled then return end

enabled = false
Tool.GripForward = Vector3.new(0,-.759,-.651)
Tool.GripPos = Vector3.new(1.5,-.5,.3)
Tool.GripRight = Vector3.new(1,0,0)
Tool.GripUp = Vector3.new(0,.651,-.759)


Tool.Handle.DrinkSound:Play()

wait(3)

local h = Tool.Parent:FindFirstChild("Humanoid")
if (h ~= nil) then
	if (h.MaxHealth > h.Health + 5) then
		h.Health = h.Health + 5
	else	
		h.Health = h.MaxHealth
	end
end

Tool.GripForward = Vector3.new(-.976,0,-0.217)
Tool.GripPos = Vector3.new(0.03,0,-0.3)
Tool.GripRight = Vector3.new(.217,0,-.976)
Tool.GripUp = Vector3.new(0,1,0)

enabled = true

end

function onEquipped() Tool.Handle.OpenSound:play() end

script.Parent.Activated:connect(onActivated) script.Parent.Equipped:connect(onEquipped)

1 answer

Just create an explosion and position it where you need

wait(2.7)

local Explosion = Instance.new("Explosion")
Explosion.Position = Tool.Handle.Position
Explosion.Parent = Tool

Make sure to parent it ASAP because explosions dissapear after few seconds if not parented because they explode right after being created.

So here is the whole script:

local Tool = script.Parent;

enabled = true

function onActivated() if not enabled then return end
enabled = false
Tool.GripForward = Vector3.new(0,-.759,-.651)
Tool.GripPos = Vector3.new(1.5,-.5,.3)
Tool.GripRight = Vector3.new(1,0,0)
Tool.GripUp = Vector3.new(0,.651,-.759)


Tool.Handle.DrinkSound:Play()

wait(3)
-----------------
local Explosion = Instance.new("Explosion")
Explosion.Position = Tool.Handle.Position
Explosion.Parent = Tool
-----------------

local h = Tool.Parent:FindFirstChild("Humanoid")
if (h ~= nil) then
    if (h.MaxHealth > h.Health + 5) then
        h.Health = h.Health + 5
    else    
        h.Health = h.MaxHealth
    end
end

Tool.GripForward = Vector3.new(-.976,0,-0.217)
Tool.GripPos = Vector3.new(0.03,0,-0.3)
Tool.GripRight = Vector3.new(.217,0,-.976)
Tool.GripUp = Vector3.new(0,1,0)

enabled = true
end

function onEquipped() Tool.Handle.OpenSound:play() end

script.Parent.Activated:connect(onActivated) script.Parent.Equipped:connect(onEquipped)

2 comments

0

thanks dude it helped????

0

no problem????

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