Honestly, I been having a huge issue with Block creation, and I made an effort to make a blocking system, but the way of detection is such a pain to me. The biggest issue of what is what I should represent the other humanoid as, or just work around something else.
function CombatHandler.Blocking(Player, Character, ePlayer, Count)
local Character = Player.Character
local Hum = Character.Humanoid
local eCharacter = ePlayer.Character
local eHuman = eCharacter.Humanoid
local Distance = Character.Position.Magnitude - eCharacter.Position.Magnitude
local HitBoxDistance = eCharacter.CFrame - Hitbox.CFrame
local HBD2 = HitBoxDistance:Dot(eHuman.CFrame.LookVector)
for _, Players in pairs(LT:GetChildren()) do
if Character.Position.Magnitude <= Distance and Players.Position.Magnitude and LT ~= Character and Players.Character.Humanoid.Health > 0 then
if Players.Humanoid:FindFirstChild("IsBlocking") == true then
if Players.Character.CFrame <= HBD2 then
Hitbox:Destroy()
if Count == 4 then
local GBValue = Instance.new("BoolValue")
GBValue.Parent = Players.Character.Humanoid
Players.Character.Humanoid.WalkSpeed = 0
Players.Character.Humanoid.JumpPower = 0
Debris:AddItem(GBValue, 2)
Players.Character.Humanoid.WalkSpeed = 16
Players.Character.Humanoid.JumpPower = 50.125
end
break
end
end
end
end
```
--Here's the script. Only thing that wasn't seen is the hitbox, which is just
Honestly, I just want to delete the hitbox from the person who fired the other event, or offset the damage by like 5. The /5 method is a bit foreign to me though so I’m not really willing to make that effort and do that.
Well, if you do come back or if someone takes over, here’s the printed things.
16:14:43.795 Player1 Block - Server - BlockHandler:21
16:14:43.796 Player1 nil - Server - BlockHandler:22
16:14:43.802 ServerScriptService.BlockHandler:25: attempt to index nil with 'Humanoid' - Server - BlockHandler:25
16:14:43.803 Stack Begin - Studio
16:14:43.803 Script 'ServerScriptService.BlockHandler', Line 25 - Studio - BlockHandler:25
16:14:43.803 Stack End - Studio
The issue is that I don’t know how would I carry the values over to the Module otherwise, because I have little to no idea on how I would find the enemy humanoid unless I just decided to completely to do the Blocking on the Server Script with no module.
UIS.InputBegan:Connect(function(Input, IsTyping)
if Input.KeyCode == Enum.KeyCode.F and Debounce == false then
if not IsTyping then
Debounce = true
ButtonDown = true
RS.Block:FireServer("Block")
while ButtonDown == true do
wait()
end
RS.Release:FireServer("Release")
wait(.9)
Debounce = false
end
end
end)
(These paraments are useless I believe, so I’ll be clearing them out. It was for a previous blocking system I tried similar to this one (which failed as well))
Yeah, but even if this is sent how would I really give it a value via the localscript. This variable is meant to be for the closest/enemy player that the character might be facing.
How would I do that from the local script and detect the enemy Player. Or maybe I’m misunderstanding.
Please correct me if I’m wrong, but you want me to send over the ePlayer as the already existing Player to represent the enemy? Or rather me create a detection script to see who’s close and send whoever is found over to the server script?
You’d need to do that, since that is what you’re trying to do.
I am unsure what you are trying to achieve currently so I cannot give you many details regarding that.