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

How do I add effects to weapons?

Asked by 5 years ago

So I am making a wide variety of weapons and some of them I want to have a cool effect such as set a player on fire if they get hit with the weapon. If anyone could help me with this that would be great! Thanks!

1 answer

Log in to vote
1
Answered by
Pyracel 55
5 years ago
Edited 5 years ago

This is a very broad question, and it sounds like you are inexperienced. I'd suggest trying to create your own weapons first, that will give you more of an idea on how to do what you want with scripting. Since we don't know what weapons you are talking about, there isn't much help we can give.

If they are simple melee weapons, you could try putting this script inside the blade of the weapon. It will place fire instances into the parts of humanoids that it touches.

local Blade = script.Parent

Blade.Touched:connect(function(hit) --When the blade hits a part, make a variable called "hit" that is what the blade touched.

if hit.Parent:FindFirstChild("Humanoid") then --If the part that was touched is part of a Humanoid then

if not hit.Parent.Fire then

local Fire = Instance.new("Fire") --Create the fire instance.

Fire.Parent = hit --Place the fire into the body part.

wait(10) --Wait 10 seconds.

Fire:Destroy() --Destroy the fire.

end

end

end)
0
I am creating the weapons myself and they are melee weapons. tawk1215 47 — 5y
0
I added to my original post. Pyracel 55 — 5y
0
Thanks! tawk1215 47 — 5y
Ad

Answer this question