Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 7 years ago

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

Log in to vote
0
Answered by
cabbler 1942 Moderation Voter
7 years ago
Edited 7 years ago

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

0
Ok now i need to make it not spammable. riverroger 0 — 7y
Ad

Answer this question