local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local FireworkFireRemote = ReplicatedStorage:WaitForChild('Fire')
local Debris = game:GetService("Debris")
FireworkFireRemote.OnClientEvent:Connect(function(Start, Middle, Finish, FireworkLength, FireworkClone, ColorPoints, ExplosionDetail, OrbSizePoints)
Debris:AddItem(Middle, 35)
local function lerp(Part0, Part1, Time)
return Part0 * (1-Time) + Part1 * Time
end
local function quad(p0,p1,p2,t)
local l1 = lerp(p0, p1, t)
local l2 = lerp(p1, p2, t)
local quad = lerp(l1,l2, t)
return quad
end
local function CreatePath()
for i = 1,FireworkLength do
local t = i/65
local updated = quad(Start.Position, Middle.Position, Finish.Position, t)
FireworkClone.Position = updated
wait(.01)
if i == FireworkLength then
local Effects = FireworkClone.Attachment:WaitForChild("SparksRelease")
local Launch = FireworkClone.Attachment:WaitForChild("Launch")
Launch:Play()
wait(.05)
Effects.Color = ColorSequence.new(ColorPoints)
local Sound1 = FireworkClone.Attachment:WaitForChild("Firework")
Sound1:Play()
Debris:AddItem(FireworkClone, 20)
Effects:Emit(ExplosionDetail)
end
end
end
CreatePath()
end)
One of your arguments is nil, which is producing this error. Try printing each argument on the client to see which one doesn’t exist, and check if you are firing the correct values to the remote.
Assuming the code is not detecting updated as a Vector3 so you could try replacing FireworkClone.Position = updated with FireworkClone.Position = Vector3.new(updated)
To me this seems like you are experiencing a parameter issue in your code. You react to the FireworkFireRemote Event and you take multiple parameters even though the first parameter for RemoteEvents is always the PlayerInstance of the client that the LocalScript fired from.
As your script now tries to get the position of the player instance it errors as a player instance does not contain a position property.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local FireworkFireRemote = ReplicatedStorage:WaitForChild('Fire')
local Debris = game:GetService("Debris")
FireworkFireRemote.OnClientEvent:Connect(function(player, Start, Middle, Finish, FireworkLength, FireworkClone, ColorPoints, ExplosionDetail, OrbSizePoints)
Debris:AddItem(Middle, 35)
local function lerp(Part0, Part1, Time)
return Part0 * (1-Time) + Part1 * Time
end
local function quad(p0,p1,p2,t)
local l1 = lerp(p0, p1, t)
local l2 = lerp(p1, p2, t)
local quad = lerp(l1,l2, t)
return quad
end
local function CreatePath()
for i = 1,FireworkLength do
local t = i/65
local updated = quad(Start.Position, Middle.Position, Finish.Position, t)
FireworkClone.Position = updated
wait(.01)
if i == FireworkLength then
local Effects = FireworkClone.Attachment:WaitForChild("SparksRelease")
local Launch = FireworkClone.Attachment:WaitForChild("Launch")
Launch:Play()
wait(.05)
Effects.Color = ColorSequence.new(ColorPoints)
local Sound1 = FireworkClone.Attachment:WaitForChild("Firework")
Sound1:Play()
Debris:AddItem(FireworkClone, 20)
Effects:Emit(ExplosionDetail)
end
end
end
CreatePath()
end)
Hmm. that’s a different error. It seems that “FireworkLength”, one of the variables that you pass when the event is fired, is nil. If you want me to help you it would be necessary to show me the LocalScript responsible for firing the event to see what variables you pass there.