Good afternoon dear developers we need help will be very grateful in our game has happened bug.
- Need to fix the bug with hands
- When walking/jumping with hands happens with animation/script and for some reason the hands start to shake
- no idea how to fix this problem
We need to fix a problem with animations/scripts I would be very grateful if you can help with this problem.
local UserinputService = game:GetService("UserInputService")
UserinputService.InputBegan:Connect(function(input, gameproceseed)
if gameproceseed then return end
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.E then
local Team = player:FindFirstChild("Team")
if Team ~= nil then
local Element = Team:FindFirstChild("Element")
if Element ~= nil then
-- STAT CHANGE
player.Character.Humanoid.WalkSpeed = 4
player.Character.Humanoid.JumpPower = 0
-- SHOULDERS
local RightShoulder = player.Character.Torso:FindFirstChild("Right Shoulder")
local RightArm = player.Character:FindFirstChild("Right Arm")
local LeftShoulder = player.Character.Torso:FindFirstChild("Left Shoulder")
local LeftArm = player.Character:FindFirstChild("Left Arm")
local LeftOffset = LeftShoulder.C0
local RightOffset = RightShoulder.C0
if Element.Value == "ICE" then
-- MAGIC
local IceMagicRight = RightArm:FindFirstChild("IceMagic")
if IceMagicRight == nil then
IceMagicRight = ReplicatedStorage.IceMagic:Clone()
IceMagicRight.Parent = RightArm
end
local IceMagicLeft = LeftArm:FindFirstChild("IceMagic")
if IceMagicLeft == nil then
IceMagicLeft = ReplicatedStorage.IceMagic:Clone()
IceMagicLeft.Parent = LeftArm
end
-- MAGIC RATE
for i,v in pairs(IceMagicRight:GetChildren()) do
if v:IsA("ParticleEmitter") then
v.Rate = ReplicatedStorage.IceMagic:FindFirstChild(v.Name).Rate
end
end
for i,v in pairs(IceMagicLeft:GetChildren()) do
if v:IsA("ParticleEmitter") then
v.Rate = ReplicatedStorage.IceMagic:FindFirstChild(v.Name).Rate
end
end
local run = RunService.Heartbeat:Connect(function(dt)
task.wait(dt)
if UserinputService:IsKeyDown(Enum.KeyCode.E) then
if IceMagicRight and IceMagicLeft then
if RightShoulder and LeftShoulder then
local mousePosition = mouse.Hit.Position
local Ally = game.Players:FindFirstChild(player:FindFirstChild("Team").Value)
IceBreeze:FireServer(Ally, mousePosition, LeftOffset, RightOffset, true)
RightShoulder.C0 = Point_C0_To_Mouse(RightShoulder, CFrame.lookAt(RightArm.Position, mousePosition)) * CFrame.Angles(0,math.deg(-25), math.deg(-90))
IceMagicRight.CFrame = RightArm.CFrame * CFrame.new(0,-RightArm.Size.Y,0) * CFrame.Angles(0,0,math.rad(180))
LeftShoulder.C0 = Point_C0_To_Mouse(LeftShoulder, CFrame.lookAt(LeftArm.Position, mousePosition)) * CFrame.Angles(0,math.deg(25), math.deg(90))
IceMagicLeft.CFrame = LeftArm.CFrame * CFrame.new(0,-LeftArm.Size.Y,0) * CFrame.Angles(0,0,math.rad(180))
end
end
else
local Ally = game.Players:FindFirstChild(player:FindFirstChild("Team").Value)
IceBreeze:FireServer(Ally, nil, LeftOffset, RightOffset, false)
player.Character.Humanoid.JumpPower = 50
player.Character.Humanoid.WalkSpeed = 16
RightShoulder.C0 = RightOffset
LeftShoulder.C0 = LeftOffset
for i,v in pairs(IceMagicRight:GetChildren()) do
if v:IsA("ParticleEmitter") then
v.Rate = 0
end
end
for i,v in pairs(IceMagicLeft:GetChildren()) do
if v:IsA("ParticleEmitter") then
v.Rate = 0
end
end
return 0
end
end)
end
if Element.Value == "FIRE" then
-- MAGIC
local FireMagicRight = RightArm:FindFirstChild("FireMagic")
if FireMagicRight == nil then
FireMagicRight = ReplicatedStorage.FireMagic:Clone()
FireMagicRight.Parent = RightArm
end
local FireMagicLeft = LeftArm:FindFirstChild("FireMagic")
if FireMagicLeft == nil then
FireMagicLeft = ReplicatedStorage.FireMagic:Clone()
FireMagicLeft.Parent = LeftArm
end
-- MAGIC RATE
for i,v in pairs(FireMagicRight:GetChildren()) do
if v:IsA("ParticleEmitter") then
v.Rate = ReplicatedStorage.FireMagic:FindFirstChild(v.Name).Rate
end
end
for i,v in pairs(FireMagicLeft:GetChildren()) do
if v:IsA("ParticleEmitter") then
v.Rate = ReplicatedStorage.FireMagic:FindFirstChild(v.Name).Rate
end
end
--local Hitbox = Instance.new("Part", player.Character)
--Hitbox.Name = "FireMagicHitbox"
--Hitbox.Transparency = 0.5
--Hitbox.Color = Color3.fromRGB(255, 0, 0)
--Hitbox.Size = script.Value.Value
--Hitbox.Anchored = true
--Hitbox.CanCollide = false
local run = RunService.Heartbeat:Connect(function(dt)
task.wait(dt)
--Hitbox.Size = script.Value.Value
if UserinputService:IsKeyDown(Enum.KeyCode.E) then
if FireMagicRight and FireMagicLeft then
if RightShoulder and LeftShoulder then
local mousePosition = mouse.Hit.Position
local Ally = game.Players:FindFirstChild(player:FindFirstChild("Team").Value)
FireBreeze:FireServer(Ally, mousePosition, LeftOffset, RightOffset, true)
RightShoulder.C0 = Point_C0_To_Mouse(RightShoulder, CFrame.lookAt(RightArm.Position, mousePosition)) * CFrame.Angles(0,math.deg(-25), math.deg(-90))
FireMagicRight.CFrame = RightArm.CFrame * CFrame.new(0,-RightArm.Size.Y,0) * CFrame.Angles(0,0,math.rad(180))
--Hitbox.CFrame = player.Character.HumanoidRootPart.CFrame * CFrame.new(0,-(LeftArm.Size.Y + Hitbox.Size.Y/2),0) * CFrame.Angles(0,math.deg(25),0)
LeftShoulder.C0 = Point_C0_To_Mouse(LeftShoulder, CFrame.lookAt(LeftArm.Position, mousePosition)) * CFrame.Angles(0,math.deg(25), math.deg(90))
FireMagicLeft.CFrame = LeftArm.CFrame * CFrame.new(0,-LeftArm.Size.Y,0) * CFrame.Angles(0,0,math.rad(180))
end
end
else
local Ally = game.Players:FindFirstChild(player:FindFirstChild("Team").Value)
FireBreeze:FireServer(Ally, nil, LeftOffset, RightOffset, false)
player.Character.Humanoid.JumpPower = 50
player.Character.Humanoid.WalkSpeed = 16
RightShoulder.C0 = RightOffset
LeftShoulder.C0 = LeftOffset
for i,v in pairs(FireMagicRight:GetChildren()) do
if v:IsA("ParticleEmitter") then
v.Rate = 0
end
end
for i,v in pairs(FireMagicLeft:GetChildren()) do
if v:IsA("ParticleEmitter") then
v.Rate = 0
end
end
return 0
end
end)
end
end
end
end
end
end)
Any help would be appreciated!