How to Turn Into a Local Script

I am trying to make a Local script inside StarterPlayerScripts | Documentation - Roblox Creator Hub that will create, format and place the ParticleEmitter into the Player. That way when the player loads into the game or respawns the Emitter is already loaded into their avatar and you can just Enable it true or false.

How do I do this?

local player = game.Players.LocalPlayer
local character = player.Character

local function connectCharacter(character)
	local emitter = Instance.new("ParticleEmitter")
	-- Apply settings
	emitter.Parent = character:WaitForChild("HumanoidRootPart")
end

player.CharacterAdded:Connect(connectCharacter)

if character then
	connectCharacter(character)
end
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.