I need help with my parameters, i recently discovered you can’t get a module script from a local script so i decided to pass the parameters to a server so it can fire from there, however somewhere along the way the parameters move up one time, please help.
local script
UIS.InputBegan:Connect(function(input, gpe)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
if plr:FindFirstChild("eStun") == true then return end
if db then return end
if not equipped then return end
db = true
if tick() - ctime > 2 then
cpunch = 0
end
if cpunch == 0 then
hum.WalkSpeed = 5
hum.JumpPower = 0
h1:Play()
HBE:FireServer(char, hum, hrp, 1.5,.5, 2)
h1.Ended:Connect(function()
hum.WalkSpeed = 16
hum.JumpPower = 50
cpunch = 1
db = false
end)
–server script
local hitevent = game.ReplicatedStorage.PlayerEvents.HitBoxEvent
local Hitbox = require(game.ServerScriptService["M1's"].HITBOX)
hitevent.OnServerEvent:Connect(function(char, hum, hrp, dmg,deletetime,punchnum)
Hitbox.M1(char,hum,hrp,dmg,deletetime,punchnum)
end)
–hitbox module
local module = {}
function module.M1(char,hum,hrp,dmg,deletetime,punchnum)
local weld = Instance.new("Weld")
local HB = Instance.new("Part")
local debris = game:GetService("Debris")
local rs = game.ReplicatedStorage
local hitanims = rs.Animations.hitAnimations
local Kb = require(game.ServerScriptService["M1's"].Knockback)
weld.Parent = char
HB.Parent = char
HB.Massless = true
HB.CastShadow = false
HB.Transparency = 0
HB.Massless = true
HB.CanQuery = false
HB.CanCollide = false
HB.Size = Vector3.new(3,3,3)
HB.CFrame = hrp.CFrame + hrp.CFrame.LookVector * Vector3.new(2).X + Vector3.new(0,0)
weld.C0 = HB.CFrame:Inverse()
weld.C1 = hrp.CFrame:Inverse()
weld.Part0 = HB
weld.Part1 = hrp
debris:AddItem(HB, deletetime)
debris:AddItem(weld, deletetime)