So my light beam works but other people cant see it supposedly because its in a local script. I tried transfereing it into a script but i dont know how to change the strings to fit the script. Help!

Here is the Local Script:

local Tool = script.Parent
local player = game:GetService("Players").LocalPlayer
local Character = player.Character

local en = true
Tool.Equipped:Connect(function(mouse)
print("Tool equipped!")
if not en then return end
en = false
Tool.RemoteEvent:FireServer(mouse.Hit)
 wait(.5)
 en = true
		
 Tool.Activated:Connect(function()
	print("Mouse pressed!")
	local ray = Ray.new(Tool.Handle.CFrame.p, (mouse.Hit.p - 			Tool.Handle.CFrame.p).unit * 300)
	local part, position = workspace:FindPartOnRay(ray, player.Character, false, true)

	local beam = Instance.new("Part", workspace)
	beam.BrickColor = BrickColor.new("New Yeller")
	beam.FormFactor = "Custom"
	beam.Material = "Neon"
	beam.Transparency = 0.25
	beam.Anchored = true
	beam.Locked = true
	beam.CanCollide = false

	local distance = (Tool.Handle.CFrame.p - position).magnitude
	beam.Size = Vector3.new(.5, .5, distance)
	beam.CFrame = CFrame.new(Tool.Handle.CFrame.p, position) * CFrame.new(0, 0, -distance / 2)

	game:GetService("Debris"):AddItem(beam, 1)
	

	
	
	
	
	
	
	
	
	
	if part then
		local humanoid = part.Parent:FindFirstChild("Humanoid")

		if not humanoid then
			humanoid = part.Parent.Parent:FindFirstChild("Humanoid")
		end

		if humanoid then
			humanoid:TakeDamage(30)
		end
	end
	
	beam.Touched:Connect(function(hit)
		local Sound = Instance.new("Sound")
		Sound.SoundId = "rbxasset://sounds//Rocket shot.wav"
		Sound.Parent = player.Character.HumanoidRootPart
		Sound.PlaybackSpeed = 1
		Sound.Volume = .5
		Sound.MaxDistance = 500
		Sound:Play()
		if not en then return end
 en = false

		for i = 1,10 do
			local Explosion = Instance.new("Part")
			Explosion.BrickColor = BrickColor.new("New Yeller")
			Explosion.Shape = Enum.PartType.Ball
			Explosion.Material = "Neon"
			Explosion.FormFactor = "Custom"
			Explosion.Transparency = 0.25
			Explosion.Size = Vector3.new(50,50,50)
			Explosion.CanCollide = false
			Explosion.Anchored = true
			Explosion.Locked = true
			Explosion.CFrame = beam.CFrame
			Explosion.Parent = game.Workspace
			game.Debris:AddItem(Explosion,1)
			wait(0.005)
			Explosion.Size = Vector3.new(55,55,55)
			wait(0.005)
			Explosion.Size = Vector3.new(58,58,58)
			wait(0.005)
			Explosion.Size = Vector3.new(60,60,60)
			wait(0.005)
			Explosion.Size = Vector3.new(65,65,65)
			wait(0.005)
			Explosion.Size = Vector3.new(70,70,70)
			wait(0.005)
			Explosion.Size = Vector3.new(75,75,75)
			
			
			wait()
			en = true
			
		end
		
	end)
	end)


end)

--I used the raycating script :)

7 comments

0

Indent your code please

1

They don't see it because you're creating the beam on the client. You will need to either have the server create the beam or have the server tell the other clients to render it. You could use RemoteEvents for this.

0

local scripts make everything invisible to other players..

0

FE is a pain for communication between client and server and other client lol

0

so help me put it into a script then

0

This isn't a requesting site..

0

Well, you received your answer. This is a 100+ line script, and you're requesting us to make it FE compatible for you.