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

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

Asked by 4 years ago
Edited 4 years ago

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

01enabled = false
02Tool.GripForward = Vector3.new(0,-.759,-.651)
03Tool.GripPos = Vector3.new(1.5,-.5,.3)
04Tool.GripRight = Vector3.new(1,0,0)
05Tool.GripUp = Vector3.new(0,.651,-.759)
06 
07 
08Tool.Handle.DrinkSound:Play()
09 
10wait(3)
11 
12local h = Tool.Parent:FindFirstChild("Humanoid")
13if (h ~= nil) then
14    if (h.MaxHealth > h.Health + 5) then
15        h.Health = h.Health + 5
View all 26 lines...

end

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

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

1 answer

Log in to vote
0
Answered by
imKirda 4491 Moderation Voter Community Moderator
4 years ago
Edited 4 years ago

Just create an explosion and position it where you need

1wait(2.7)
2 
3local Explosion = Instance.new("Explosion")
4Explosion.Position = Tool.Handle.Position
5Explosion.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:

01local Tool = script.Parent;
02 
03enabled = true
04 
05function onActivated() if not enabled then return end
06enabled = false
07Tool.GripForward = Vector3.new(0,-.759,-.651)
08Tool.GripPos = Vector3.new(1.5,-.5,.3)
09Tool.GripRight = Vector3.new(1,0,0)
10Tool.GripUp = Vector3.new(0,.651,-.759)
11 
12 
13Tool.Handle.DrinkSound:Play()
14 
15wait(3)
View all 41 lines...
0
thanks dude it helped???? WesleyAng_3 153 — 4y
0
no problem???? imKirda 4491 — 4y
Ad

Answer this question