Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how do I make a beam only show for the player?

I assume you have to use a local script but I'm lost. basically dumbed down I need to make a beam attach from the players uppertorso to a part in workspace, but it can only show for the player. how would I go about doing this? I can do it with a server script but the beam shows up for everyone

2 comments

0

I'll look into it

0

Use a remote event and copy the beam code to the onclientevent

2 answers

✓ Accepted answer

Solution You use the localPlayer's Character, but first wait until it is loaded in.


Player = game.Players.LocalPlayer
Player.CharacterAdded:connect(function(Character)
	wait(1)
	function CreateBeam()
		
		--Creating Attachment
		local Attachment = Instance.new("Attachment")
		Attachment.Parent = workspace.Part
		
		--Creating Beam
		local Beam = Instance.new("Beam")
		Beam.Parent = workspace
		
		Beam.Attachment0 = Attachment
		
		Beam.Attachment1 = Character:FindFirstChild("UpperTorso"):FindFirstChild("BodyFrontAttachment")
		Beam.Texture = "rbxassetid://5197916121"
		
	end
	
	CreateBeam()
end)

1 comment

0

You use a remote event to trigger it, or inside of the script

Create the beam inside a local script You can use a remote event to use the server to tell the player when to create the beam

This discussion is preserved as it was. New answers, comments, and votes are closed.