Part Infront of Player Wont Show to Others

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)

Your script is a localscript right? It will only show to the local player.

If you want to you could either change it to a server script or use remote events/functions depending on what you have to do

Yes exactly, game.Players.LocalPlayer

It will only show to the localplayer

alright so witch option is better? remote event or script? because am trying to make a clone of the part that’s in workspace that will spawn Infront of the character.

Depends, do you want something that the player has to make in his GUI to make the block appear or is it simply a touched event?

If its gui you should use remote events, but tell us

Its a gui button on screen that you have to click.

If you have a GUI you’ll need to use remote events, it’s better

alright so use a remote event in ReplicatedStorage?

Add a script in serverscript service that checks for the remote event and then makes the block appear

Yea, wherever you’d like, you just need to know a bit of remote events

added the script. but I don’t really know how to check remove events. I haven’t used them since am trying to learn more to scripting.

Check the devforum about remote events from client to server, you’ll learn it quickly, it’s just some bit of lines

attack and attack 1 is a part in workspace and its a gui button

Ah it’s a billboard UI it seems

oh. no its actully a gui. Attack is a part and attack 1 is the gui button

where would I find about remote events?

Search in google: remote events roblox and the documentation will probably show up

Check if everything in your code is correct before doing that tho

how do you type things inside a remote event?

i think i found it but it telling the script to make a new part