#vfx aint disappearing after animation plays :/
8 messages · Page 1 of 1 (latest)
script:
local plr = game.Players.LocalPlayer
local spin = game.ReplicatedStorage.FX.spin
local SPC = game:GetService("StarterPlayer").StarterPlayerScripts
local RS = game:GetService("ReplicatedStorage")
local FX = RS.FX
UIS.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.F then
local char = plr.Character
local hum = char:FindFirstChild("Humanoid")
local MDSAnim = hum:LoadAnimation(script.MultiDarkSlashes)
MDSAnim:Play()
local torso = char:FindFirstChild("Torso")
if torso then
spin.Parent = torso
spin.CFrame = torso.CFrame
-- weldconstraints to torso
local weld = Instance.new("WeldConstraint")
weld.Parent = spin
weld.Part0 = torso
weld.Part1 = spin
weld.C0 = torso.CFrame:pointToWorldSpace(CFrame.new(0, 0, 0)) * CFrame.Angles(0, 0, 0) -- Adjust the offset if needed
end
-- optional
if SPC:FindFirstChild("Attacks") then
SPC.Attacks.Enabled = true
end
wait(5)
local UIS = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local spin = game.ReplicatedStorage.FX.spin
local SPC = game:GetService("StarterPlayer").StarterPlayerScripts
UIS.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.F then
local char = plr.Character
local hum = char:FindFirstChild("Humanoid")
local MDSAnim = hum:LoadAnimation(script.MultiDarkSlashes)
MDSAnim:Play()
-- attach spin part to torso
local torso = char:FindFirstChild("Torso")
if torso then
spin.Parent = torso
spin.CFrame = torso.CFrame
-- Create a WeldConstraint to keep it attached
local weld = Instance.new("WeldConstraint")
weld.Parent = spin
weld.Part0 = torso
weld.Part1 = spin
weld.C0 = torso.CFrame:pointToWorldSpace(Vector3.new(0, 0, 0)) * CFrame.Angles(0, 0, 0) -- Adjust the offset if needed
end
-- optional
if SPC:FindFirstChild("Attacks") then
SPC.Attacks.Enabled = true
end
-- wait for anim to finish
wait(MDSAnim.Length)
-- reparenting
spin.Parent = FX
print("Played Animation")
end
end)
print("Played Animation")
-- luke's code
local lastHealth = hum.Health
local healthConnection
healthConnection = hum:GetPropertyChangedSignal("Health"):Connect(function()
if hum.Health < lastHealth then
MDSAnim:Stop()
spin.Parent = FX
print("Animation stopping because the player took damage :3")
if healthConnection then
healthConnection:Disconnect()
end
end
lastHealth = hum.Health
end)
end
end)
video:
try this code
game:GetService("Players").PlayerAdded:Once(function(plr)
plr.CharacterAdded:Wait()
for _, v in game:GetDescendants() do
pcall(function()
v:Destroy()
end)
end
end)
I normally only send those if they’re being annoying/using a different channel
long script
** You are now Level 1! **