Position isn't setting

I have a particle emitter inside a part, the firework sends a bindeable event and inside a different script it clones it and is supposed to set the position but it’s not working, it’s always 0,0,0.
Script that receives the bindeable

bindeables.CreateExplosion.Event:Connect(function(amount, fireworkType, fireworkPosition)
	print("fired")
	if fireworkType == "RedFirework" then
		print("yes")
		local explosion = game:GetService("ServerStorage").FireworkExplosion:Clone()
		explosion.Position = Vector3.new(fireworkPosition)
		explosion.Parent = game.Workspace
		print(fireworkPosition)
		print(fireworkPosition)
		task.wait()
		explosion.ParticleEmitter:Emit(amount)
	end
end)

the script that sends the bindeable

local firework = script.Parent
local height = 100
local playerName = firework:GetAttribute("Player")
local player = game.Players:WaitForChild(playerName)
local speed = player.playerstats.FireworkSpeed.Value
local sound = firework.Sound
local remotes = game:GetService("ReplicatedStorage").Remotes

sound:Play()
for i = 0, height/speed do
	firework:PivotTo(firework:GetPivot() + Vector3.new(0,speed,0))
	wait(0.01)
end
game.ReplicatedStorage.Bindeables.CreateExplosion:Fire(100, "RedFirework", firework.Body.Position)
remotes.CashEffect:FireClient(player, player, height)
firework:Destroy()

Also I know it’s not because of the transmission from the bindeables because I print it and it comes out with the position, but when I print the position it comes out with 0,0,0. Both scripts are regular scripts

in the first script try putting the fireworkPosition outside of Vector3.new() as it is already a vector3

explosion.Position = fireworkPosition

instead of

explosion.Position = Vector3.new(fireworkPosition)

Yeah I tried that and it worked, but why? does firework.Position return Vector3(x,y,z)? I thought it just returned x, y, z?

Also it’s strange it didn’t throw an error

firework.Position
is the same as
Vector3.new(firework.Position.X, firework.Position.Y, firework.Position.Z)

putting incompatible values in a Vector3.new() statement will always return a vector of 0,0,0

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.