#need help with vfx code

1 messages · Page 1 of 1 (latest)

dawn merlin
#

idrc about the animation rn

#

im just tryna get the wind and my orb to enable at the same time

#

and only be enabled = false after like 0.5 seconds then emit my expulsion and projectile

vapid silo
dawn merlin
#

cframe them

vapid silo
dawn merlin
#

i meam

#

i didnt eben code tjis

#

sum dude was meant to

#

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local character = player.Character
local HRP = character.HumanoidRootPart
local LeftLegAtt = character["Left Leg"].LeftFootAttachment :: Attachment

local VFX = game.ReplicatedStorage.VFX
local vfx = game.ReplicatedStorage.SyntaxThing

local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")

local function emitVFX(effect:ParticleEmitter)

local emitCount = effect:GetAttribute("EmitCount")
local emitDelay = effect:GetAttribute("EmitDelay")
local duration = effect:GetAttribute("EmitDuration")

local lifeTimeMax = effect.Lifetime.Max

if emitDelay then

    task.wait(emitDelay)

end

if emitCount then effect:Emit(emitCount) end

if duration then 
    effect.Enabled = true
    task.wait(duration)
    effect.Enabled = false
end

task.wait(lifeTimeMax)

effect:Destroy()

end

--[[
Finds all the VFX in a given part and given path and then parents it to the given parent
This will automatically play the VFX too using the emitVFX function
]]
local function clonePlayVFX(part,pathing,parent)

for _, effect in part[pathing]:GetChildren() do

    local clonedEffect = effect:Clone()
    clonedEffect.Parent = parent
    task.spawn(emitVFX, clonedEffect)

end

end

UserInputService.InputBegan:Connect(function(key, isTyping)

if isTyping or key.KeyCode ~=
#

like im having trouble

vapid silo
#

This script just seems way too overly complicated for what it achieves to be frank

#

I am also going to guess that the clonePlayVFX just gets fired on input, and that that's basically the rest of the code

vapid silo
#

Well, anyways, seems to be an attribute issue, one seems to just have a delay

dawn merlin
#

im just gona rewrite it

#

in pseudo code

#

and hopefully someone can translate

vapid silo
dawn merlin
vapid silo
#

Luau isn't all that different from proper psuedo

dawn merlin
#

oh uh

#

i have an idea

#

i need to move my attachments to one place

#

since i want them to be at the same spot anywyas

#

then just use emit delays

vapid silo
dawn merlin
#

None of my parts move

vapid silo
#

the player is most definitely moving

dawn merlin
#

its welded

#

because an animation plays

#

animation is scuffed rn and needs events

vapid silo
#

So, the player remains stationary on the ground?

dawn merlin
#

good bye

vapid silo
#

Yikes...

#

You're just contradicting yourself and then getting pissed at me for that

dawn merlin
#

i can send u it

unkempt zenith
#

alr

dawn merlin
unkempt zenith
#
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local character = player.Character
local HRP = character.HumanoidRootPart
local LeftLegAtt = character["Left Leg"].LeftFootAttachment :: Attachment

local vfx = game.ReplicatedStorage.SyntaxThing

local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")

local function emitVFX(effect: ParticleEmitter)
    local emitCount = effect:GetAttribute("EmitCount")
    local emitDelay = effect:GetAttribute("EmitDelay")
    local duration = effect:GetAttribute("EmitDuration")
    local lifeTimeMax = effect.Lifetime.Max

    if emitDelay then
        task.wait(emitDelay)
    end

    if emitCount then
        effect:Emit(emitCount)
    end

    if duration then 
        effect.Enabled = true
        task.wait(duration)
        effect.Enabled = false
    end

    task.wait(lifeTimeMax)
    effect:Destroy()
end

-- Finds all the VFX in a given part and given path and then parents it to the given parent
-- This will automatically play the VFX too using the emitVFX function
local function clonePlayVFX(part, pathing, parent)
    for _, effect in part[pathing]:GetChildren() do
        local clonedEffect = effect:Clone()
        clonedEffect.Parent = parent
        task.spawn(emitVFX, clonedEffect)
    end
end

UserInputService.InputBegan:Connect(function(key, isTyping)
    if isTyping or key.KeyCode ~= Enum.KeyCode.V then return end

    HRP.Anchored = true

    for i = 1, 15 do
        HRP.CFrame = HRP.CFrame:Lerp(CFrame.new(HRP.Position, Vector3.new(mouse.Hit.X, HRP.Position.Y, mouse.Hit.Z)), 0.1)
        task.wait()
    end

    local Players = game:GetService("Players")
    local ReplicatedStorage = game:GetService("ReplicatedStorage")

    local player = Players.LocalPlayer
    local character = player.Character or player.CharacterAdded:Wait()
    local humanoid = character:WaitForChild("Humanoid")

    -- Wait for the Animation to exist in ReplicatedStorage
    local animation = ReplicatedStorage:WaitForChild("Animation")

    -- Load and play the animation
    local track = humanoid:LoadAnimation(animation)
    track:Play()


    local tween = TweenService:Create(HRP, TweenInfo.new(1.5, Enum.EasingStyle.Exponential, Enum.EasingDirection.InOut), {CFrame = HRP.CFrame + Vector3.new(0,30,0)})
    tween:Play()
    task.wait(1)

    clonePlayVFX(vfx.lol, "Startup", LeftLegAtt)
    task.wait(0.425)

    -- Enable WindEnable directly
    local windPart = vfx.lol:FindFirstChild("WindEnable")
    if windPart and windPart:IsA("Part") then
        local clonedWind = windPart:Clone()
        clonedWind.CFrame = CFrame.new(LeftLegAtt.WorldPosition)
        clonedWind.Transparency = 1 -- fixed: transparency 0 shows it
        for _, v in pairs(clonedWind:GetDescendants()) do
            if v:IsA("ParticleEmitter") then
                v.Enabled = true
            end
        end

        local weld = Instance.new("WeldConstraint")
        weld.Part0 = clonedWind
        weld.Part1 = character["Left Leg"]
        weld.Parent = clonedWind

        -- parent WindEnable clone to unique VFX folder
        local vfxFolder = workspace:FindFirstChild("VFX_"..player.Name) or Instance.new("Folder")
        vfxFolder.Name = "VFX_"..player.Name
        vfxFolder.Parent = workspace
        clonedWind.Parent = vfxFolder

        task.wait(0.6)
        clonedWind:Destroy()
    end

    -- projectile (still placeholder here, implement as needed)
    task.wait(1.2)
    HRP.Anchored = false
end)
#

had to resend to see here

ruby gazelle
#

so from what i read so far some guy commisioned this and made a mistake?

dawn merlin
#

i just asked some dude for help

#

and he helped

#

and said

ruby gazelle
#

oh thats nice then

dawn merlin
#

“im dropping this” mid way through

ruby gazelle
#

what the f###?

dawn merlin
#

without even telling me what the variables are and new folders

#

before there was 2 variables

ruby gazelle
#

thats messed up :(

dawn merlin
#

local vfx and local VFX

#

i was confused

dawn merlin
unkempt zenith
#

if u want both ur wind and fireball to be enabled at the same time then there shouldnt be a task.wait here

dawn merlin
#

ngl

#

this script is just very confusing for me

#

I just gave up

ruby gazelle
#

considering you werent actually the one who wrote it thats fair

hoary sentinelBOT
#

studio** You are now Level 9! **studio

dawn merlin
#

it was worse before

dawn merlin
#

idk how to explain but

#

my wind particles are in a part

#

in a part

ruby gazelle
#

oh its an effect?

#

show explorer

dawn merlin
#

part > windpart > particles
orbattachment > particles

#

its loke this

dawn merlin
#

its stressing me out a lot

ruby gazelle
#

fair

dawn merlin
#

ive been doing this for 7 hours

ruby gazelle
#

jesus

dawn merlin
#

Funny thing is

#

im applying for e2

#

and

#

i spent x3 time on the coding

#

lol

ruby gazelle
#

whats e2

dawn merlin
#

vfx 2

#

/ effects

ruby gazelle
#

oh 💀

#

sounds cool though

ruby gazelle
dawn merlin
#

nope

ruby gazelle
#

it's probably this

dawn merlin
#

i dont know how to reference them

#

when i do a for loop

unkempt zenith
#

xd

dawn merlin
unkempt zenith
#

sob

#

alr

#

il try

dawn merlin
#

dms

dawn merlin
#

done