--[[Local Script]]--
player = game:GetService("Players").LocalPlayer
cas = game:GetService("ContextActionService")
rep = game:GetService("ReplicatedStorage")
userEvents = rep:WaitForChild("UserEvents")
events = {}
events.Punch = userEvents:WaitForChild("Punch")
cooldowns = {}
cooldowns.Punch = {["debounce"] = false, ["Time"] = 1}
info = {}
info.Punch = {["Side"] = true}
functions = {}
functions.Input = function(action, state, InputObj)
if InputObj.UserInputType == Enum.UserInputType.MouseButton1 then
if cooldowns.Punch.debounce then return end
cooldowns.Punch.debounce = true
functions.Punch()
wait(cooldowns.Punch.Time)
cooldowns.Punch.debounce = false
end
end
functions.Punch = function()
local Punch = events.Punch
if info.Punch.Side then
Punch:FireServer(player, info.Punch.Side)
info.Punch.Side = false
else if not info.Punch.Side then
Punch:FireServer(player, info.Punch.Side)
info.Punch.Side = true
end
end
end
cas:BindAction("Punch", functions.Input, false, Enum.UserInputType.MouseButton1)
--[[Script]]--
rep = game:GetService("ReplicatedStorage")
standuserEvents = rep:WaitForChild("StandUserEvents")
punchEvent = userEvents:WaitForChild("Punch")
punchEvent.OnServerEvent:Connect(function(player, side)
print(side)
end)
I did alot of things like changing args positions re-writing the both scripts but nothing worked.

1 comment
Tysm, now i can continue my project and its right i dont need specify the player and stuff.