HitZone.partEntered:Connect(function(hitpart)
if hitpart.Parent:FindFirstChild("Humanoid") ~= nil and hitpart.Parent:FindFirstChild("CoreValues") ~= nil and
hitpart.Parent.Name ~= hoststring.Value and not table.find(TableHitCharacters, hitpart.Parent) then
local hitchar = hitpart.Parent
table.insert(TableHitCharacters, hitchar)
print("hit: " .. hitchar.Name)
if HitboxTypeString == "Juggle" then
end
end
end)
I have this code here inside a modulescript named ‘coremodule’ that has many different functions that can be called by server scripts, which has functions like putting a player in a certain state, launching a player, etc. This code here just makes sure that a player who was hit by the part already doesn’t do the code under the if check twice or more, and checks if the part owner is not the one being touched. But i want to have a way to customise what happens when the part is touched for each move, instead of just having a single event in a modulescript. It probably sounds quite confusing and i get that and if you want clarification then feel free to ask.
function module.InvokeHitEffect(offenseplr, equippedEffect)
end
function module.InvokeHitstun(plrwhogothit, offenseplr, hitstuntime)
local corevalues = plrwhogothit.Character.CoreValues
local actionable = corevalues.Actionable
end
function module.WeakHitPlayer(plrwhogothit)
end
function module.JugglePlayer(plrwhogothit, height, duration)
end
function module.LaunchPlayer(plrwhogothit, offenseplr)
end
^ coremodule functions that i want to call when a player gets hit using an event or function inside the move script below
if core.Actionable.Value == true and core.InHitstun.Value == false then -- check if player wasnt hit
currentmove = coroutine.create(function()
print("electric")
coremodule.SetCoreValues({core.Actionable}, false)
char.Humanoid.WalkSpeed = 0
char.Humanoid.Animator:LoadAnimation(animations.WGFanim):Play(nil, nil, 1.4)
voice.TimePosition = 34.6
task.spawn(function()
voice:Play()
task.wait(0.7)
voice:Stop()
end)
local ironaura
task.wait(ewgfStartup)
local Hitbox = coremodule.CreateHitbox(hitboxes.EWGFhitbox, player, CFrame.new(0, 0.1, -5), 0.25, "Juggle")
-- i want to have some way that i can call functions from the coremodule in any move rather than just having one event in coremodule that handles the hit function
task.wait(ewgfRecovery)
coremodule.SetCoreValues({core.Actionable}, true)
char.Humanoid.WalkSpeed = defaultwalkspeed
end)
Again, i want the event in coremodule to still determine if hit is legal, but if it is, then i want a function or event or whatever to be called thats inside a move function, so i can customise what happens in every move (if a move should launch, be armored, etc.)…