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

Why doesn't the fireball shoot from my character?

Asked by 8 years ago
Player = script.Parent.Parent
Character = Player.Character
Mouse = Player:GetMouse()
function onKeyDown(key) 
    key = key:lower() 
    if key == "z" then 
        local x = Instance.new("Part") 
        x.TopSurface = "Smooth" 
        x.BottomSurface = "Smooth" 
        x.Shape = "Ball" 
        x.Transparency = 0.7
        x.BrickColor = BrickColor.new("Bright red") 
        local c = Instance.new("ParticleEmitter")
        c.Parent = x
        c.Texture = "http://www.roblox.com/asset/?id=255306233"
        c.LightEmission = 0.4
        c.Rate = 20
        local f = Instance.new("Fire") 
        f.Parent = x 
        f.Size = 12 
        f.Heat = 0 
        local bt = Instance.new("BodyVelocity", x)
        bt.maxForce = Vector3.new(math.huge,math.huge,math.huge)
        bt.Velocity = Player.Character.Torso.CFrame.lookVector*80
        bt.Parent = x  
        x.Parent = workspace 

    end 
end
Mouse.KeyDown:connect(onKeyDown) -- Goes in starterpack

For some reason where the fireball shoots is in the middle of the map and not from the character (Press z when in game and you will see) NEEDS TO BE IN STARTERPACK! I think it's something to do with bodyvelocity ;/ Also it's a local script

Answer this question