I'm trying to make a candy wich makes you faster and makes you have a rainbow trail on consumption, But i get an error i do not understand, Can someone help me?
Script:
function Eat() script.Parent.Parent.Humanoid.WalkSpeed = 75 script.Parent.Parent.Head.Trail.Transparency = 0.4 wait(5) script.Parent.Parent.Humanoid.WalkSpeed = 16 script.Parent.Parent.Head.Trail.Transparency = 1 wait(0.01) script.Parent:Destroy() end script.Parent.Activated:connect(Eat)
Error:
Workspace.Nyan Candy.Script:3: bad argument #3 to 'Transparency' (NumberSequence expected, got number)
ParticleEmitters have properties that require specific datatypes. The reasoning behind this correlates with the lifetime of the particle :: by taking in a NumberSequence
instead of just a number, the particle can have different transparencies at different parts of its life.
Use the NumberSequence.new constructor
function Eat() script.Parent.Parent.Humanoid.WalkSpeed = 75 script.Parent.Parent.Head.Trail.Transparency = NumberSequence.new(.4) wait(5) script.Parent.Parent.Humanoid.WalkSpeed = 16 script.Parent.Parent.Head.Trail.Transparency = NumberSequence.new(1) wait(0.01) script.Parent:Destroy() end script.Parent.Activated:connect(Eat)