Hello. I have been trying to find out to spawn a part Infront of the player. I did it. but then it’s just not showing up to other players and killing them. I have tried looking on devforum but none of them are helping me.
local Player = game.Players.LocalPlayer
local Player2 = game.Players
local Attack1 = script.Parent.Attack1
local Attack2 = script.Parent.Attack2
local Attack3 = script.Parent.Attack3
Attack1.MouseButton1Click:Connect(function()
game.Workspace.Attack:Clone().Parent = game.Workspace
game.Workspace.Attack1:Clone().Parent = game.Workspace
wait(0.1)
game.Workspace.Attack.CFrame = Player.Character.Torso.CFrame * CFrame.new(0,0,-10)
game.Workspace.Attack1.CFrame = Player.Character.Torso.CFrame * CFrame.new(0,0,-10)
script.Parent.Attack1.Visible = false
wait(0.1)
game.Workspace.Attack.CFrame = game.Workspace.Attack1.CFrame * CFrame.new(0,0,-1)
wait(0.1)
game.Workspace.Attack.CFrame = game.Workspace.Attack1.CFrame * CFrame.new(0,0,-2)
wait(0.1)
game.Workspace.Attack.CFrame = game.Workspace.Attack1.CFrame * CFrame.new(0,0,-3)
wait(0.1)
game.Workspace.Attack.CFrame = game.Workspace.Attack1.CFrame * CFrame.new(0,0,-4)
wait(0.1)
game.Workspace.Attack.CFrame = game.Workspace.Attack1.CFrame * CFrame.new(0,0,-5)
wait(0.1)
game.Workspace.Attack.CFrame = game.Workspace.Attack1.CFrame * CFrame.new(0,0,-6)
wait(0.1)
game.Workspace.Attack.CFrame = game.Workspace.Attack1.CFrame * CFrame.new(0,0,-7)
wait(0.1)
game.Workspace.Attack.CFrame = game.Workspace.Attack1.CFrame * CFrame.new(0,0,-8)
wait(0.1)
game.Workspace.Attack.CFrame = game.Workspace.Attack1.CFrame * CFrame.new(0,0,-9)
wait(0.1)
game.Workspace.Attack.CFrame = game.Workspace.Attack1.CFrame * CFrame.new(0,0,-10)
wait(0.1)
game.Workspace.Attack:Destroy()
game.Workspace.Attack1:Destroy()
wait(3)
script.Parent.Attack1.Visible = true
end)
game.Workspace.Attack.Touched:Connect(function()
Player.Character.Humanoid.Health = Player.Character.Humanoid.Health -1
end)