#need help with vfx code
1 messages · Page 1 of 1 (latest)
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
Just activate them at the same time, the only real reason I can see there being a reasonable delay is you calling functions that have yields in them
i dont even know how to
cframe them
?, are you not using a constraint in the player character?
i am
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
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
literally bro
Well, anyways, seems to be an attribute issue, one seems to just have a delay
Or just write it in luau
no bc im not good
Luau isn't all that different from proper psuedo
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
then just don't have them parented to a part that moves...
None of my parts move
the player is most definitely moving
So, the player remains stationary on the ground?
good bye
is this the code
alr
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
so from what i read so far some guy commisioned this and made a mistake?
ty
i didnt commission him
i just asked some dude for help
and he helped
and said
oh thats nice then
“im dropping this” mid way through
what the f###?
without even telling me what the variables are and new folders
before there was 2 variables
thats messed up :(
mhm
if u want both ur wind and fireball to be enabled at the same time then there shouldnt be a task.wait here
considering you werent actually the one who wrote it thats fair
** You are now Level 9! **
lol
it was worse before
try this
the thing is
idk how to explain but
my wind particles are in a part
in a part
fair
ive been doing this for 7 hours
jesus
whats e2
did you actually try this though?
nope
it's probably this
i can send u it lol
dms
done