Стики Финегр способность T
Создано: 13 декабря 2024 г.
Создано: 13 декабря 2024 г.
создай новую способность для Стики финегр из джоджо, стики фингер на кнопку T отделяет свою руку от тела, и делает длинный heavypunch, который станет противника на 2 секунды, для роблокс студио, вот скрипты Server : local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")
local mainFolder = game.ReplicatedStorage.StandFolder.SF
local Summon = mainFolder.RemoteEvents.Summon
local Punching = mainFolder.RemoteEvents.Punching
local HeavyEvent = mainFolder.RemoteEvents.Heavy
local BarrageEvent = mainFolder.RemoteEvents.Barrage
local StopEvent = mainFolder.RemoteEvents.TimeStop
local BeatdownEvent = mainFolder.RemoteEvents.Beatdown
Summon.OnServerEvent:Connect(function(player, isActive)
local char = player.Character
local hrp = char.HumanoidRootPart
textif isActive == true then local Stand = mainFolder.Models.Stand:Clone() local mainPart = Stand.PrimaryPart Stand.Parent = char mainPart.CFrame = hrp.CFrame local weld = Instance.new("ManualWeld") weld.Name = "Weld" weld.Part0 = mainPart weld.Part1 = hrp weld.C0 = mainPart.CFrame:ToObjectSpace(hrp.CFrame) weld.Parent = weld.Part0 for i, bodyPart in pairs(Stand:GetDescendants()) do if bodyPart:IsA("BasePart") or bodyPart:IsA("MeshPart") then if bodyPart ~= mainPart then local info = TweenInfo.new(0.45) local goal = {Transparency = 0} local tween = TweenService:Create(bodyPart, info, goal) tween:Play() end end end local info = TweenInfo.new(0.5) local goal = {} goal.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame) goal.C1 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame * CFrame.new(-3, 1.5, 3)) local tween = TweenService:Create(weld, info, goal) tween:Play() local AnimControl = Stand.AnimationController local Idle = AnimControl:LoadAnimation(mainFolder.Animations.Idle) Idle:Play() local sound = mainFolder.Sounds.Summon:Clone() sound.Parent = Stand.HumanoidRootPart sound:Play() sound.Stopped:Connect(function() sound:Destroy() end) local TorsoAura = mainFolder.Aura:WaitForChild("BodyAura"):Clone() TorsoAura.Parent = char:WaitForChild("Torso") TorsoAura.Name = "TorsoAura" local HeadAura = mainFolder.Aura:WaitForChild("HeadAura"):Clone() HeadAura.Parent = char.Head local RAAura = mainFolder.Aura:WaitForChild("BodyAura"):Clone() RAAura.Parent = char:WaitForChild("Right Arm") RAAura.Name = "RAAura" local LAAura = mainFolder.Aura:WaitForChild("BodyAura"):Clone() LAAura.Parent = char:WaitForChild("Left Arm") LAAura.Name = "LAAura" local RLAura = mainFolder.Aura:WaitForChild("BodyAura"):Clone() RLAura.Parent = char:WaitForChild("Right Leg") RLAura.Name = "RLAura" local LLAura = mainFolder.Aura:WaitForChild("BodyAura"):Clone() LLAura.Parent = char:WaitForChild("Left Leg") LLAura.Name = "LLAura" else local Stand = char:FindFirstChild("Stand") local mainPart = Stand.PrimaryPart if Stand then if Stand.PrimaryPart:FindFirstChild("Weld") then local weld = Stand.PrimaryPart:FindFirstChild("Weld") for i, bodyPart in pairs(Stand:GetDescendants()) do if bodyPart:IsA("BasePart") or bodyPart:IsA("MeshPart") and bodyPart ~= mainPart then local info = TweenInfo.new(0.45) local goal = {Transparency = 1} local tween = TweenService:Create(bodyPart, info, goal) tween:Play() end end local info = TweenInfo.new(0.5) local goal = {} goal.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame) goal.C1 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame) local tween = TweenService:Create(weld, info, goal) tween:Play() char.Torso:WaitForChild("TorsoAura"):Destroy() char.Head:WaitForChild("HeadAura"):Destroy() char["Right Arm"]:WaitForChild("RAAura"):Destroy() char["Left Arm"]:WaitForChild("LAAura"):Destroy() char["Right Leg"]:WaitForChild("RLAura"):Destroy() char["Left Leg"]:WaitForChild("LLAura"):Destroy() tween.Completed:Connect(function() Stand:Destroy() end) end end end
end)
Punching.OnServerEvent:Connect(function(player, currentAttack)
local char = player.Character
local Stand = char:FindFirstChild("Stand")
local weld = Stand.HumanoidRootPart:FindFirstChild("Weld")
local combatModule = require(script.Combat)
textif Stand then if currentAttack == 1 then combatModule.Main(weld, TweenService, Stand, mainFolder.Animations.RightPunch, char, currentAttack) elseif currentAttack == 2 then combatModule.Main(weld, TweenService, Stand, mainFolder.Animations.LeftPunch, char, currentAttack) elseif currentAttack == 3 then combatModule.Main(weld, TweenService, Stand, mainFolder.Animations.Smash, char, currentAttack) end end
end)
HeavyEvent.OnServerEvent:Connect(function(player)
local char = player.Character
local Stand = char:FindFirstChild("Stand")
local weld = Stand.PrimaryPart:FindFirstChild("Weld")
textlocal combatModule = require(script.Combat) if Stand then local PunchAnim = Stand.AnimationController:LoadAnimation(mainFolder.Animations.HeavyPunch) PunchAnim:Play() local info = TweenInfo.new(0.5) local goal = {} goal.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame) goal.C1 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame * CFrame.new(0,0,-3)) local tween = TweenService:Create(weld, info, goal) tween:Play() local effectFolder = Instance.new("Folder") effectFolder.Name = "Effect" effectFolder.Parent = workspace combatModule.Heavy(Stand, char, effectFolder, mainFolder, TweenService) wait(0.5) local goal2 = {} goal2.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame) goal2.C1 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame * CFrame.new(-3, 1.5, 3)) local back = TweenService:Create(weld, info, goal2) back:Play() delay(2, function() game.Debris:AddItem(effectFolder, 0.1) end) end
end)
BarrageEvent.OnServerEvent:Connect(function(player, isActive)
local char = player.Character
local Stand = char:FindFirstChild("Stand")
local weld = Stand.HumanoidRootPart:FindFirstChild("Weld")
textlocal combatModule = require(script.Combat) local Anim = Stand.AnimationController:LoadAnimation(mainFolder.Animations.Barrage) local effectFolder = Instance.new("Folder") effectFolder.Name = "Effect" effectFolder.Parent = workspace if Stand then if isActive == true then local info = TweenInfo.new(0.5) local goal = {} goal.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame) goal.C1 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame * CFrame.new(0,0,-3)) local tween = TweenService:Create(weld, info, goal) tween:Play() char.Humanoid.WalkSpeed = 4 char.Humanoid.JumpPower = 0 delay(0.1, function() sound = game.ReplicatedStorage.StandFolder.SF.Sounds.Barrage:Clone() sound.Parent = Stand.HumanoidRootPart sound:Play() Anim:Play() combatModule.Barrage(Stand, char, effectFolder, TweenService) end) spawn(function() wait(3) local info = TweenInfo.new(0.5) local goal = {} goal.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame) goal.C1 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame * CFrame.new(-3, 1.5, 3)) local tween = TweenService:Create(weld, info, goal) tween:Play() for i, track in pairs(Stand.AnimationController:GetPlayingAnimationTracks()) do if track then track:Stop() end end Stand.AnimationController:LoadAnimation(mainFolder.Animations.Idle):Play() sound.Stopped:Connect(function() wait(1) sound:Destroy() end) combatModule.Clean(effectFolder) char.Humanoid.WalkSpeed = 16 char.Humanoid.JumpPower = 50 end) elseif isActive == false then local info = TweenInfo.new(0.5) local goal = {} goal.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame) goal.C1 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame * CFrame.new(-3, 1.5, 3)) local tween = TweenService:Create(weld, info, goal) tween:Play() for i, track in pairs(Stand.AnimationController:GetPlayingAnimationTracks()) do if track then track:Stop() end end sound:Destroy() Stand.AnimationController:LoadAnimation(mainFolder.Animations.Idle):Play() combatModule.Clean(effectFolder) char.Humanoid.WalkSpeed = 16 char.Humanoid.JumpPower = 50 end end
end)
StopEvent.OnServerEvent:Connect(function(player)
local StopValue = mainFolder.Stop
textlocal char = player.Character local Stand = char:FindFirstChild("Stand") local weld = Stand.HumanoidRootPart:FindFirstChild("Weld") if Stand then if StopValue.Value == true then return else StopValue.Value = true local info = TweenInfo.new(0.5) local goal = {} goal.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame) goal.C1 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame * CFrame.new(0,0,-3)) local tween = TweenService:Create(weld, info, goal) tween:Play() delay(0.4, function() local effectFolder = Instance.new("Folder") effectFolder.Name = "Effect" effectFolder.Parent = workspace local Anim = Stand.AnimationController:LoadAnimation(mainFolder.Animations.TimeStop) Anim:Play() delay(0.07, function() local Sphere = Instance.new("Part") Sphere.Shape = "Ball" Sphere.Name = "Sphere" Sphere.Size = Vector3.new(1,1,1) Sphere.Anchored = true Sphere.CanCollide = false Sphere.Material = Enum.Material.ForceField Sphere.CFrame = Stand.HumanoidRootPart.CFrame Sphere.Parent = effectFolder Sphere.CastShadow = false local SizeInfo = TweenInfo.new(1, Enum.EasingStyle.Quart, Enum.EasingDirection.Out, 1, true) local SizeTween1 = TweenService:Create(Sphere, SizeInfo, {Size = Vector3.new(50,50,50)}) SizeTween1:Play() local Color = Instance.new("ColorCorrectionEffect") Color.Parent = game.Lighting local ColorInfo = TweenInfo.new(0.6, Enum.EasingStyle.Sine, Enum.EasingDirection.In) local ColorTween = TweenService:Create(Color, info, {Saturation = -2, Contrast = -2}) ColorTween:Play() local sound = mainFolder.Sounds.TheWorld:Clone() sound.Parent = Stand.HumanoidRootPart sound:Play() sound.Stopped:Connect(function() sound:Destroy() end) wait(1.7) game.Debris:AddItem(effectFolder, 0.1) local info = TweenInfo.new(0.5) local goal = {} goal.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame) goal.C1 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame * CFrame.new(-3, 1.5, 3)) local tween = TweenService:Create(weld, info, goal) tween:Play() for i, Players in pairs(workspace:GetDescendants()) do if Players:FindFirstChild("Humanoid") then if Players ~= char then for i, Parts in pairs(Players:GetDescendants()) do if Parts:IsA("MeshPart") or Parts:IsA("Part")then spawn(function() Parts.Anchored = true wait(10) Parts.Anchored = false local ColorReverse = TweenService:Create(Color, info, {Saturation = 0, Contrast = 0}) ColorReverse:Play() wait(0.5) Color:Destroy() end) end end end end end wait(10) StopValue.Value = false end) end) end end
end)
BeatdownEvent.OnServerEvent:Connect(function(player)
local char = player.Character
local hrp = char.HumanoidRootPart
local hum = char.Humanoid
textlocal Stand = char:FindFirstChild("Stand") local mainPart = Stand.PrimaryPart local weld = mainPart:FindFirstChild("Weld") local Theme = mainFolder.Sounds.OraBeat:Clone() if Stand then local info = TweenInfo.new(0.5) local goal = {} goal.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame) goal.C1 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame * CFrame.new(0, 0, -3)) local tween = TweenService:Create(weld, info, goal) tween:Play() local hitbox = Instance.new("Part", Stand) hitbox.Anchored = false hitbox.CanCollide = false hitbox.Size = char.HumanoidRootPart.Size hitbox.CFrame = Stand.HumanoidRootPart.CFrame * CFrame.new(0, 0, -2.5) hitbox.Transparency = 1 local hitboxWeld = Instance.new("ManualWeld") hitboxWeld.Name = "HitboxWeld" hitboxWeld.Part0 = hitbox hitboxWeld.Part1 = Stand.HumanoidRootPart hitboxWeld.C0 = hitbox.CFrame:ToObjectSpace(Stand.HumanoidRootPart.CFrame) hitboxWeld.Parent = weld.Part0 hitbox.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") or hit.Parent.Name == "Stand" then if not hit:IsDescendantOf(char) then local enemyHum = hit.Parent:FindFirstChild("Humanoid") local enemyChar = enemyHum.Parent local enemy = game.Players:GetPlayerFromCharacter(enemyChar) for i, parts in pairs(Stand:GetDescendants()) do if parts:IsA("MeshPart") or parts:IsA("BasePart") or parts:IsA("Decal") then parts.Transparency = 1 end end local LeanScript = Stand:WaitForChild("LeanHandler") if LeanScript then LeanScript.Disabled = true end enemyChar.HumanoidRootPart.CFrame = CFrame.new(enemyChar.HumanoidRootPart.Position, hrp.Position) hrp.CFrame = CFrame.new(hrp.Position, enemyChar.HumanoidRootPart.Position) hrp.CFrame = hrp.CFrame * CFrame.new(0, 0, 6) local Invis = TweenInfo.new(0.01) local goal = {} goal.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame) goal.C1 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame * CFrame.new(-3, 1.5, 3)) local tween = TweenService:Create(weld, Invis, goal) tween:Play() hum.WalkSpeed = 0 hum.JumpPower = 0 enemyHum.WalkSpeed = 0 enemyHum.JumpPower = 0 local animFolder = mainFolder.Animations local StartAnim = hum:LoadAnimation(animFolder.BeatdownStart) local Idle = Stand.AnimationController:LoadAnimation(animFolder.BeatdownStand) Theme.Parent = Stand.HumanoidRootPart StartAnim:Play() Theme:Play() BeatdownEvent:FireClient(player, player, enemyChar, animFolder) pcall(function() BeatdownEvent:FireClient(enemy, player, enemyChar, animFolder) end) delay(1, function() for i, bodyPart in pairs(Stand:GetDescendants()) do if bodyPart:IsA("BasePart") or bodyPart:IsA("MeshPart") or bodyPart:IsA("Decal") then if bodyPart ~= mainPart then local info = TweenInfo.new(0.45) local goal = {Transparency = 0} local tween = TweenService:Create(bodyPart, info, goal) tween:Play() end end end local info = TweenInfo.new(0.5) local goal = {} goal.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame) goal.C1 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame * CFrame.new(3.5, 1, 1)) local tween = TweenService:Create(weld, info, goal) tween:Play() Idle:Play() local Module = require(mainFolder.BeatModule) local effectFolder = Instance.new("Folder") effectFolder.Name = "Effect" effectFolder.Parent = workspace delay(1.65, function() local targetAnim = enemyChar.Humanoid:LoadAnimation(animFolder:WaitForChild("BeatdownTarget")) targetAnim:Play() wait(1) local info = TweenInfo.new(0.5) local goal = {} goal.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame) goal.C1 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame * CFrame.new(0, 0, -4)) local tween = TweenService:Create(weld, info, goal) tween:Play() end) delay(3, function() Module.Barrage(Stand, char, effectFolder, TweenService) end) delay(23.5, function() Module.Clean(effectFolder) wait(8.5) local force = Instance.new("BodyVelocity") force.MaxForce = Vector3.new(10000000, 10000000, 10000000) force.Velocity = enemyChar:WaitForChild("HumanoidRootPart").CFrame.LookVector * -60 force.Parent = enemyChar:WaitForChild("HumanoidRootPart") game.Debris:AddItem(force, 0.15) end) end) hitbox:Destroy() wait(35) local info = TweenInfo.new(0.5) local goal = {} goal.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame) goal.C1 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame * CFrame.new(-3, 1.5, 3)) local tween = TweenService:Create(weld, info, goal) tween:Play() hum.WalkSpeed = 16 hum.JumpPower = 50 enemyHum.WalkSpeed = 16 enemyHum.JumpPower = 50 end else delay(0.5, function() local info = TweenInfo.new(0.5) local goal = {} goal.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame) goal.C1 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame * CFrame.new(-3, 1.5, 3)) local tween = TweenService:Create(weld, info, goal) tween:Play() hitbox:Destroy() end) end end) wait(1.5) hitbox:Destroy() end
end)
local: local mainFolder = game.ReplicatedStorage.StandFolder.SF
local camera = workspace.CurrentCamera
local Summon = mainFolder.RemoteEvents.Summon
local Punching = mainFolder.RemoteEvents.Punching
local HeavyEvent = mainFolder.RemoteEvents.Heavy
local BarrageEvent = mainFolder.RemoteEvents.Barrage
local StopEvent = mainFolder.RemoteEvents.TimeStop
local BeatdownEvent = mainFolder.RemoteEvents.Beatdown
local UIS = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local camera = workspace.CurrentCamera
local summonDebounce = false
local isActive = false
local isBlocking = false
local Attack = false
local HeavyPunch = false
local Beatdown = false
local Barrage = false
local TimeStop = false
local debounce = false
local resetTime = 0
local nextCombo = 1
local function fade(target, Value)
spawn(function()
for i, v in pairs(target:GetDescendants()) do
if v:IsA("Decal") or v:IsA("BasePart") or v:IsA("MeshPart") then
if v.Name ~= "HumanoidRootPart" then
v.Transparency = Value
end
end
end
end)
end
UIS.InputBegan:Connect(function(key, gameProcess)
if gameProcess then
return
elseif key.KeyCode == Enum.KeyCode.Q then
if summonDebounce == false and isActive == false and script:GetAttribute("activated") == false then
summonDebounce = true
isActive = true
script:SetAttribute("activated", true)
textSummon:FireServer(isActive) wait(0.55) summonDebounce = false script:SetAttribute("activated", false) elseif summonDebounce == false and isActive == true and script:GetAttribute("activated") == false then summonDebounce = true isActive = false script:SetAttribute("activated", true) Summon:FireServer(isActive) wait(0.55) summonDebounce = false script:SetAttribute("activated", false) end elseif key.KeyCode == Enum.KeyCode.R and script:GetAttribute("activated") == false then if HeavyPunch == false and isActive == true then HeavyPunch = true script:SetAttribute("activated", true) HeavyEvent:FireServer() wait(3.5) HeavyPunch = false script:SetAttribute("activated", false) end elseif key.KeyCode == Enum.KeyCode.E and script:GetAttribute("activated") == false then if isActive == true then if debounce == false and Barrage == false then debounce = true Barrage = true script:SetAttribute("activated", true) BarrageEvent:FireServer(Barrage) wait(0.05) debounce = false end end elseif key.KeyCode == Enum.KeyCode.B and script:GetAttribute("activated") == false then if isActive == true and Beatdown == false then Beatdown = true script:SetAttribute("activated", true) BeatdownEvent:FireServer() wait(1) Beatdown = false script:SetAttribute("activated", false) end elseif key.UserInputType == Enum.UserInputType.MouseButton1 then if isActive == true and Attack == false and script:GetAttribute("activated") == false then Attack = true script:SetAttribute("activated", true) resetTime = tick() if nextCombo > 3 then nextCombo = 1 end local current = nextCombo nextCombo += 1 Punching:FireServer(current) if nextCombo > 3 then wait(0.2) end wait(0.6) Attack = false script:SetAttribute("activated", false) wait(2) if tick() - resetTime >= 1.5 then nextCombo = 1 end end end
end)
UIS.InputEnded:Connect(function(key)
if key.KeyCode == Enum.KeyCode.E and script:GetAttribute("activated") == true then
if debounce == false and Barrage == true then
debounce = true
Barrage = false
script:SetAttribute("activated", false)
textBarrageEvent:FireServer(Barrage) wait(3) debounce = false end end
end)
Конечно! Давайте добавим новую способность для Стики Финегр из JoJo в вашем проекте Roblox Studio. Способность будет активироваться при нажатии клавиши T и будет выполнять следующие действия:
Ниже приведены шаги для реализации этой способности, включая необходимые изменения в серверных и клиентских скриптах, а также рекомендации по созданию анимаций и эффектов.
Добавьте новый RemoteEvent
в ReplicatedStorage
:
RemoteEvent
и назовите его, например, HeavyPunch
.Обновите серверный скрипт для обработки нового события:
Добавьте обработчик для нового HeavyPunch
события в ваш серверный скрипт. Ниже приведен пример того, как это можно сделать, основываясь на вашем текущем скрипте.
lua-- В вашем серверном скрипте local HeavyPunchEvent = mainFolder.RemoteEvents.HeavyPunch HeavyPunchEvent.OnServerEvent:Connect(function(player) local char = player.Character local hrp = char.HumanoidRootPart local hum = char.Humanoid local Stand = char:FindFirstChild("Stand") local mainPart = Stand.PrimaryPart local weld = mainPart:FindFirstChild("Weld") if Stand then -- Отделяем руку от тела local arm = Stand:FindFirstChild("Right Arm") -- Предполагаем, что используется правая рука if arm then -- Разрываем Weld между телом и рукой local armWeld = arm:FindFirstChild("Weld") if armWeld then armWeld:Destroy() end -- Добавляем физику к отделенной руке arm.Anchored = false local bv = Instance.new("BodyVelocity") bv.Velocity = Stand.CFrame.LookVector * 50 -- Настройте скорость по необходимости bv.MaxForce = Vector3.new(500000, 500000, 500000) bv.Parent = arm -- Воспроизведение анимации Heavy Punch local punchAnim = Stand.AnimationController:LoadAnimation(mainFolder.Animations.HeavyPunch) punchAnim:Play() -- Звуковой эффект local sound = mainFolder.Sounds.HeavyPunchSound:Clone() sound.Parent = Stand.HumanoidRootPart sound:Play() -- Создание ударной зоны local hitbox = Instance.new("Part") hitbox.Size = Vector3.new(2, 2, 4) hitbox.Transparency = 1 hitbox.CanCollide = false hitbox.Anchored = true hitbox.CFrame = arm.CFrame * CFrame.new(0, 0, -2) hitbox.Parent = workspace -- Обработка столкновений hitbox.Touched:Connect(function(hit) local enemyHum = hit.Parent:FindFirstChild("Humanoid") if enemyHum and enemyHum.Parent ~= char then -- Оглушение противника enemyHum:ChangeState(Enum.HumanoidStateType.Physics) enemyHum.WalkSpeed = 0 enemyHum.JumpPower = 0 -- Возврат к нормальному состоянию через 2 секунды delay(2, function() if enemyHum and enemyHum.Parent then enemyHum.WalkSpeed = 16 -- Стандартная скорость ходьбы enemyHum.JumpPower = 50 -- Стандартная высота прыжка end end) end end) -- Возвращение руки к телу после удара delay(1, function() -- Удаляем BodyVelocity if bv then bv:Destroy() end -- Удаляем hitbox if hitbox then hitbox:Destroy() end -- Возвращаем руку arm.Anchored = true local weldNew = Instance.new("ManualWeld") weldNew.Part0 = mainPart weldNew.Part1 = arm weldNew.C0 = CFrame.new(1.5, 0.5, 0) -- Настройте положение руки weldNew.Parent = mainPart -- Восстанавливаем анимацию punchAnim:Stop() local idleAnim = Stand.AnimationController:LoadAnimation(mainFolder.Animations.Idle) idleAnim:Play() end) end end end)
Пояснения к коду:
Weld
, связывающий руку с телом, и к руке добавляется BodyVelocity
для имитации отделения.Weld
.Добавьте необходимые анимации и звуки:
mainFolder.Animations
под именем HeavyPunch
.mainFolder.Sounds
под именем HeavyPunchSound
.Добавьте обработку нажатия клавиши T в ваш клиентский скрипт. Предполагается, что вы уже имеете клиентский скрипт, аналогичный предоставленному вами. Добавим новый обработчик для клавиши T.
lua-- В вашем клиентском скрипте local HeavyPunchEvent = mainFolder.RemoteEvents.HeavyPunch -- Добавляем обработку клавиши T UIS.InputBegan:Connect(function(key, gameProcess) if gameProcess then return end if key.KeyCode == Enum.KeyCode.T and script:GetAttribute("activated") == false then if isActive == true and HeavyPunch == false then HeavyPunch = true script:SetAttribute("activated", true) HeavyPunchEvent:FireServer() -- Добавляем задержку, чтобы предотвратить повторное использование wait(1.5) -- Настройте время по необходимости HeavyPunch = false script:SetAttribute("activated", false) end end -- Остальной код обработки других клавиш... end)
Пояснения к коду:
isActive
(стенд активен) и HeavyPunch
не активен.script:SetAttribute("activated", true)
для предотвращения повторного использования способности до завершения текущей.HeavyPunchEvent
.Обновите переменные состояния (если необходимо):
Убедитесь, что переменные isActive
, HeavyPunch
и activated
правильно инициализированы и управляются в вашем скрипте. В предоставленном вами клиентском скрипте они уже присутствуют, но убедитесь, что добавление новой способности не нарушает текущую логику.
Создайте анимацию тяжелого удара:
ReplicatedStorage.StandFolder.SF.Animations
под именем HeavyPunch
.Добавьте звуковой эффект тяжелого удара:
ReplicatedStorage.StandFolder.SF.Sounds
под именем HeavyPunchSound
.Добавьте визуальные эффекты для усиления способности:
Effect
, создаваемую в серверном скрипте, или непосредственно в модель Стенда.После внесения всех изменений рекомендуется протестировать новую способность, чтобы убедиться, что она работает корректно.
wait
и delay
там, где это возможно, чтобы избежать потенциальных задержек или конфликтов.lualocal TweenService = game:GetService("TweenService") local RunService = game:GetService("RunService") local mainFolder = game.ReplicatedStorage.StandFolder.SF local Summon = mainFolder.RemoteEvents.Summon local Punching = mainFolder.RemoteEvents.Punching local HeavyEvent = mainFolder.RemoteEvents.Heavy local BarrageEvent = mainFolder.RemoteEvents.Barrage local StopEvent = mainFolder.RemoteEvents.TimeStop local BeatdownEvent = mainFolder.RemoteEvents.Beatdown local HeavyPunchEvent = mainFolder.RemoteEvents.HeavyPunch -- Новый RemoteEvent -- Остальная часть вашего существующего серверного скрипта... HeavyPunchEvent.OnServerEvent:Connect(function(player) local char = player.Character local hrp = char.HumanoidRootPart local hum = char.Humanoid local Stand = char:FindFirstChild("Stand") if not Stand then return end local mainPart = Stand.PrimaryPart local weld = mainPart:FindFirstChild("Weld") if not weld then return end -- Отделяем руку от тела local arm = Stand:FindFirstChild("Right Arm") -- Предполагаем, что используется правая рука if arm then -- Разрываем Weld между телом и рукой local armWeld = arm:FindFirstChild("Weld") if armWeld then armWeld:Destroy() end -- Добавляем физику к отделенной руке arm.Anchored = false local bv = Instance.new("BodyVelocity") bv.Velocity = Stand.CFrame.LookVector * 50 -- Настройте скорость по необходимости bv.MaxForce = Vector3.new(500000, 500000, 500000) bv.Parent = arm -- Воспроизведение анимации Heavy Punch local punchAnim = Stand.AnimationController:LoadAnimation(mainFolder.Animations.HeavyPunch) punchAnim:Play() -- Звуковой эффект local sound = mainFolder.Sounds.HeavyPunchSound:Clone() sound.Parent = Stand.HumanoidRootPart sound:Play() -- Создание ударной зоны local hitbox = Instance.new("Part") hitbox.Size = Vector3.new(2, 2, 4) hitbox.Transparency = 1 hitbox.CanCollide = false hitbox.Anchored = true hitbox.CFrame = arm.CFrame * CFrame.new(0, 0, -2) hitbox.Parent = workspace -- Обработка столкновений hitbox.Touched:Connect(function(hit) local enemyHum = hit.Parent:FindFirstChild("Humanoid") if enemyHum and enemyHum.Parent ~= char then -- Оглушение противника enemyHum:ChangeState(Enum.HumanoidStateType.Physics) enemyHum.WalkSpeed = 0 enemyHum.JumpPower = 0 -- Возврат к нормальному состоянию через 2 секунды delay(2, function() if enemyHum and enemyHum.Parent then enemyHum.WalkSpeed = 16 -- Стандартная скорость ходьбы enemyHum.JumpPower = 50 -- Стандартная высота прыжка end end) end end) -- Возвращение руки к телу после удара delay(1, function() -- Удаляем BodyVelocity if bv then bv:Destroy() end -- Удаляем hitbox if hitbox then hitbox:Destroy() end -- Возвращаем руку arm.Anchored = true local weldNew = Instance.new("ManualWeld") weldNew.Part0 = mainPart weldNew.Part1 = arm weldNew.C0 = CFrame.new(1.5, 0.5, 0) -- Настройте положение руки weldNew.Parent = mainPart -- Восстанавливаем анимацию punchAnim:Stop() local idleAnim = Stand.AnimationController:LoadAnimation(mainFolder.Animations.Idle) idleAnim:Play() end) end end)
lualocal mainFolder = game.ReplicatedStorage.StandFolder.SF local UIS = game:GetService("UserInputService") local TweenService = game:GetService("TweenService") local camera = workspace.CurrentCamera local Summon = mainFolder.RemoteEvents.Summon local Punching = mainFolder.RemoteEvents.Punching local HeavyEvent = mainFolder.RemoteEvents.Heavy local BarrageEvent = mainFolder.RemoteEvents.Barrage local StopEvent = mainFolder.RemoteEvents.TimeStop local BeatdownEvent = mainFolder.RemoteEvents.Beatdown local HeavyPunchEvent = mainFolder.RemoteEvents.HeavyPunch -- Новый RemoteEvent local summonDebounce = false local isActive = false local isBlocking = false local Attack = false local HeavyPunch = false local Beatdown = false local Barrage = false local TimeStop = false local debounce = false local resetTime = 0 local nextCombo = 1 local function fade(target, Value) spawn(function() for i, v in pairs(target:GetDescendants()) do if v:IsA("Decal") or v:IsA("BasePart") or v:IsA("MeshPart") then if v.Name ~= "HumanoidRootPart" then v.Transparency = Value end end end end) end UIS.InputBegan:Connect(function(key, gameProcess) if gameProcess then return end if key.KeyCode == Enum.KeyCode.Q then -- Существующая логика для Summon if summonDebounce == false and isActive == false and script:GetAttribute("activated") == false then summonDebounce = true isActive = true script:SetAttribute("activated", true) Summon:FireServer(isActive) wait(0.55) summonDebounce = false script:SetAttribute("activated", false) elseif summonDebounce == false and isActive == true and script:GetAttribute("activated") == false then summonDebounce = true isActive = false script:SetAttribute("activated", true) Summon:FireServer(isActive) wait(0.55) summonDebounce = false script:SetAttribute("activated", false) end elseif key.KeyCode == Enum.KeyCode.R and script:GetAttribute("activated") == false then -- Существующая логика для Heavy if HeavyPunch == false and isActive == true then HeavyPunch = true script:SetAttribute("activated", true) HeavyEvent:FireServer() wait(3.5) HeavyPunch = false script:SetAttribute("activated", false) end elseif key.KeyCode == Enum.KeyCode.E and script:GetAttribute("activated") == false then -- Существующая логика для Barrage if isActive == true then if debounce == false and Barrage == false then debounce = true Barrage = true script:SetAttribute("activated", true) BarrageEvent:FireServer(Barrage) wait(0.05) debounce = false end end elseif key.KeyCode == Enum.KeyCode.B and script:GetAttribute("activated") == false then -- Существующая логика для Beatdown if isActive == true and Beatdown == false then Beatdown = true script:SetAttribute("activated", true) BeatdownEvent:FireServer() wait(1) Beatdown = false script:SetAttribute("activated", false) end elseif key.UserInputType == Enum.UserInputType.MouseButton1 then -- Существующая логика для Punching if isActive == true and Attack == false and script:GetAttribute("activated") == false then Attack = true script:SetAttribute("activated", true) resetTime = tick() if nextCombo > 3 then nextCombo = 1 end local current = nextCombo nextCombo += 1 Punching:FireServer(current) if nextCombo > 3 then wait(0.2) end wait(0.6) Attack = false script:SetAttribute("activated", false) wait(2) if tick() - resetTime >= 1.5 then nextCombo = 1 end end elseif key.KeyCode == Enum.KeyCode.T and script:GetAttribute("activated") == false then -- Новый обработчик для HeavyPunch if isActive == true and HeavyPunch == false then HeavyPunch = true script:SetAttribute("activated", true) HeavyPunchEvent:FireServer() wait(1.5) -- Настройте время по необходимости HeavyPunch = false script:SetAttribute("activated", false) end end end) UIS.InputEnded:Connect(function(key) if key.KeyCode == Enum.KeyCode.E and script:GetAttribute("activated") == true then if debounce == false and Barrage == true then debounce = true Barrage = false script:SetAttribute("activated", false) BarrageEvent:FireServer(Barrage) wait(3) debounce = false end end end)
Пояснения к клиентскому скрипту:
elseif
для клавиши T, который проверяет, активен ли Стенд и не используется ли уже способность HeavyPunch
. Если все условия выполнены, отправляется серверное событие HeavyPunchEvent
.Теперь у вас есть новая способность для Стики Финегр, которая позволяет отделить руку, выполнить тяжелый удар и оглушить противника на 2 секунды при нажатии клавиши T. Убедитесь, что вы тщательно протестировали способность, настроили анимации и звуки для наилучшего игрового опыта. Если у вас возникнут вопросы или потребуется дополнительная помощь, не стесняйтесь обращаться!