I can’t change value i can’t find answer
Server script:
local function Combat(LocalPlayer, Animator, LocalHum, Punching)
local Punches = Animator:LoadAnimation(PunchAnimations[count])
if Punching and Punching.Value == false then
if count >= 1 and count <= 3 then
Punching.Value = true
Punches:Play()
count = count + 1
task.wait(.7)
Punching.Value = false
elseif count >= 4 then
Punching.Value = true
Punches:Play()
count = 1
task.wait(2)
Punching.Value = false
end
end
Punches.KeyframeReached:Connect(function(keyframe)
if keyframe == 'Punched' then
HitboxPunch(LocalPlayer)
end
end)
end
Remote.OnServerEvent:Connect(function(LocalPlayer,camera, Punching)
local LocalChar = LocalPlayer.Character
local LocalHum = LocalChar.Humanoid
local LocalHumRP = LocalChar.HumanoidRootPart
local LocalHumAnimator = LocalHum.Animator
Combat(LocalPlayer, LocalHumAnimator, LocalHum, Punching)
end)
Local:
local UIS = game:GetService("UserInputService")
local RP = game:GetService("ReplicatedStorage")
local Modules = RP:WaitForChild("Modules")
local HitboxModule = Modules.HitboxModule
local Remotes = RP:WaitForChild("Remotes")
local Remote = Remotes.HitboxRemote
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local camera = game.Workspace.CurrentCamera
local Punching = LocalPlayer.Character:WaitForChild('Punching')
UIS.InputBegan:Connect(function(input, chat)
if chat then return end
if input.UserInputType == Enum.UserInputType.MouseButton1 then
Remote:FireServer(LocalPlayer, camera, Punching)
end
end)