player = game.Players.LocalPlayer mouse = player:GetMouse() function fireball() local ball = Instance.new("Part") ball.Name="Fireball" ball.Parent=Workspace ball.Shape="Ball" ball.Size=Vector3.new(1, 1, 1) ball.Transparency=0 ball.Anchored=false ball.CanCollide=true ball.BrickColor=BrickColor.new("Bright orange") end function keyDown(key) key = key:lower() if key == "z" then fireball() end end mouse.KeyDown:connect(keyDown)
It only spawns in one area. How do I make it so, when you move, they spawn where you move??
You need to set the CFrame property to the area where you want it to appear.
player = game.Players.LocalPlayer mouse = player:GetMouse() function fireball() local ball = Instance.new("Part") ball.Name="Fireball" ball.Parent=Workspace ball.Shape="Ball" ball.Size=Vector3.new(1, 1, 1) ball.Transparency=0 ball.Anchored=false ball.CanCollide=true ball.BrickColor=BrickColor.new("Bright orange") ball.CFrame = player.Character.Torso.CFrame --add this end function keyDown(key) key = key:lower() if key == "z" then fireball() end end mouse.KeyDown:connect(keyDown)