Hi. I'm bigginer in coding and i like games who have magic skills, so i tried to make a map where is only pvp with magic skills. I tried to make this fireball and is ball "y" is not working
I want to appear "y" ball right where the "x" ball destroy.
Here's the code
local Player = game.Players.LocalPlayer
local char = Player.Character or Player.CharacterAdded:Wait()
local head = char:WaitForChild("Head")
local shot = 1
local Mouse = Player:GetMouse()
local x = Instance.new("Part")
x.BrickColor = BrickColor.new("White")
x.Shape = "Ball"
x.Material = "Neon"
x.TopSurface = "Smooth"
x.BottomSurface = "Smooth"
x.Anchored = false
x.CanCollide = false
x.Transparency = 0
x.Size = Vector3.new(40,40,40);
local y = Instance.new("Part")
y.BrickColor = BrickColor.new("Black")
y.Shape = "Ball"
y.Material = "Neon"
y.TopSurface = "Smooth"
y.BottomSurface = "Smooth"
y.Anchored = false
y.CanCollide = false
y.Transparency = 1
y.Size = Vector3.new(100, 100, 100);
Mouse.Button1Down:connect(function()
if shot == 1 then
local cl = x:Clone()
local v = Instance.new("BodyVelocity")
v.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
v.Velocity = Player.Character.Torso.CFrame.lookVector * 110
v.Parent = cl
cl.Parent = game.Workspace
cl.CFrame = Player.Character.Torso.CFrame * CFrame.new(0,1,-5)
shot = 0
wait(1)
cl:Destroy()
if cl:Destroy() then
local cly = y:Clone()
local b = Instance.new("BodyVelocity")
b.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
b.Velocity = cl.CFrame.lookVector * 1
b.Parent = cly
cly.Parent = game.Workspace
cly.CFrame = cl.CFrame * CFrame.new(0,1,-5)
wait(0.4)
cly:Destroy()
end
game.Debris:AddItem(cl, 4)
wait(0.6)
shot = 1
end
end)

2 comments
is the y ball not appearing at all or is it appearing in a wrong place?
the y ball is not appearing at all