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

How do i clone a particle emitter from lighting to a players head?

I'm trying to make a tool that when the tool is equipped you would click and a particle emitter would be inserted into the local players head. This is what i have so far..

function onClick()
game.Lighting["ParticleEmitter"]:clone().Parent = LocalPlayer.Head
end

script.Parent.onClicked:connect(onClick)

1 answer

When you index "script.Parent" your goal is to index an existing event to connect to your function. You can't just say "onClicked", it does not exist. You probably want .Activated. Also:

LocalPlayer does not exist unless you defined it.

Please use ServerStorage over Lighting. (Switch this to a server script!)

local tool = script.Parent
local sstorage = game:GetService('ServerStorage')
function onClick()
	sstorage.ParticleEmitter:clone().Parent = tool.Parent.Head
end

tool.Activated:connect(onClick)

I recommend you do some basic tutorials such as these. http://wiki.roblox.com/index.php?title=AllTutorials

1 comment

0

Ok now i need to make it not spammable.

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