Well on touch its suppose to give a particle emitter, but it seems not to work, any reason why?if so can you help?
function onTouched(hit) local s = Instance.new("ParticleEmitter") s.Parent = hit s.Size = "0.8" s.Lifetime = "5" s.Texture = "http://www.roblox.com/asset/?id=7233331" s.Transparency = "0.5" s.EmissionDirection = "Top" wait(5) s:remove() end connection = script.Parent.Touched:connect(onTouched)
try changing it to
function OnTouched(hit) local s = Instance.new("ParticleEmitter", hit) s.Size = NumberSequence.new(0.8) s.LifeTime = NumberRange.new(5) s.Texture = "http://www.roblox.com/asset/?id=7233331" s.Transparency = NumberSequence.new(0.5) s.EmissionDirection = "Top" delay(5, function() s:Destroy() end)) end script.Parent.Touched:connect(OnTouched)
As you see i add "NumberSequence" and "NumberRange" in the script because Particles are not just GUIs, it is a GUI that changes itself over time. For example:
s.Size = NumberSequence.new(0.8, 2.8) s.LifeTime = NumberRange.new(1,5) s.Transparency = NumberSequence.new(0.5,1)
But in this case, if you want a certain or a constant value, you can use a single value instead of 2
Also, before you use
connection = script.Parent.Touched:connect(OnTouched)
means you set a VARIABLE for the command but you didnt command it. What you do was: "connection means: When you are touch do this function"
script.Parent.Touched:connect(OnTouched)
means you are commanding it: "When you are touch, do this function"
script.Parent.Touched:connect(function(hit) local Humanoid = player.Parent:FindFirstChild('Humanoid') if Humanoid then
end
:p My way...