I’m trying to randomize the orientation on a part before it emits particles to give a randomized slash effect. I have tried multiple ways here and It wont change the orientation but doesn’t give me any console errors. Any help?
Effect is a part with particleEmitters as children
local VFXRemote = game.ReplicatedStorage.Remotes.VFXRemote
VFXRemote.OnClientEvent:Connect(function(data)
local Effect = data.VFX:Clone()
Effect.Parent = workspace
if data.OtherEffect == "RandomOrientation" then
Effect.CFrame = CFrame.Angles(0,math.random(math.rad(0),math.rad(360)),0)
print("Random!")
end
Effect.CFrame = data.CFrame
for i, v in Effect:GetChildren() do
if v:IsA("ParticleEmitter") then
v:Emit(v:GetAttribute("EmitCount"))
end
end
game.Debris:AddItem(Effect,data.DeleteTime)
end)
If there is any data that might be missing here please ask