Hello everyone! So i was trying to make something like a light beam skill, and i already made the beams inside a part (i made 2 parts so there will be 2 attachments for beam) and put them in replicatedStorage. And i made a script that will parent the beam parts to workspace and also will position it to character’s hand then will activate it when player uses keyword “Z”. Problem here is, i want to make it just clone the beam parts instead of putting them in workspace, you know it won’t be usable more then once. And when i try to clone it, beams not showing. I have no idea how to fix that, and here is the script in serverScriptService:
game.ReplicatedStorage.starSkill1.OnServerEvent:Connect(function(plr)
local chr = plr.Character
local vfx = game.ReplicatedStorage.starVFX:Clone()
vfx.Parent = game.Workspace
task.wait(0.2)
vfx.CFrame = chr:FindFirstChild("Torso").CFrame * CFrame.new(1.35, 0.45, -2.2)
vfx:FindFirstChild("Attachment"):FindFirstChild("ball").Enabled = true
vfx:FindFirstChild("Attachment"):FindFirstChild("ring").Enabled = true
vfx:FindFirstChild("Attachment"):FindFirstChild("star").Enabled = true
task.wait(1.3)
vfx:FindFirstChild("sfx"):Play()
task.wait(2)
vfx:FindFirstChild("Attachment"):FindFirstChild("ball").Enabled = false
vfx:FindFirstChild("Attachment"):FindFirstChild("ring").Enabled = false
vfx:FindFirstChild("Attachment"):FindFirstChild("star").Enabled = false
task.wait(0.7)
-- here is the beam part
local beamS = game.ReplicatedStorage.beamStart -- i tried to make it beamStart:Clone(), but dont working like that
local beamE = game.ReplicatedStorage.beamEnd -- also used clone() on this too
beamS.Parent = game.Workspace
beamE.Parent = game.Workspace
beamS.CFrame = chr:FindFirstChild("Torso").CFrame * CFrame.new(1.35, 0.45, -2.3)
beamE.CFrame = chr:FindFirstChild("Torso").CFrame * CFrame.new(1.35, 13, -100)
beamS.Attachment.ParticleEmitter.Enabled = true
beamS.Attachment.ParticleEmitter2.Enabled = true
beamS.Attachment.particleemitter3.Enabled = true
task.wait(0.5)
beamS.Attachment.Beam.Enabled = true
beamS.Attachment.Beam2.Enabled = true
beamE.Attachment2.ParticleEmitter2.Enabled = true
beamE.Attachment2.sparks.Enabled = true
end)
It was really complicated to explain for me, im so sorry if you cant understand it, but you can ask me any question you want about it. Thanks!