Basically, when you press the right mouse button, your character will throw a grenade from his torso. But. the script isn't working. Can anyone fix it?
function onButton2Down(m) local Grenade = Instance.new.Part Grenade.FormFactor = 0 Grenade.Reflectance = 0 Grenade.Transperancy = 0 Grenade.Size = 1,1,1 Grenade.Locked = true Grenade.CanCollide = true Grenade.Position = Owner.Torso end local Mesh = Instance.new.SpecialMesh local Special Mesh = GMesh GMesh.MeshId = "http://www.roblox.com/Asset/?id=10207236" GMesh.Parent = Grenade local Explode = Instance.new.Explosion local Explosion = Ex Ex.BlastRadius = 5 Ex.BlastPressure = 5000 Ex.ExplosionType = Nocraters Sound1.Play() local Sound = Instance.New.Sound local Sound = Sound1 Sound1.Play = false Sound1.Enabled = true
I think it's because you didn't define what onButton2Down
is. I'm not sure how to help you though other than saying that.
This script does not alter the velocity of the grenade on player's hand.