Currently, my Character is being print as nil. I have no idea why whilst I use my module so I’m pretty confused.
function Combat_Handler.BlockBar(Player,Character,Humrp,sequence,Action,enemyHumanoid)
local Character = Player.Character
local Humanoid = Character.Humanoid
if Character:FindFirstChild("BlockBar") then
BStam = Instance.new("NumberValue", Character)
BStam.Name = "BlockStamina"
BStam.Value = 100
local Stam = script.BlockStamina:Clone()
Stam.Parent = Character.Head
coroutine.create(function()
while Character.Parent == workspace.LivingThings do
if BStam.Value >= 100 then
BStam.Value = 100
Stam.Frame.Visible = false
elseif BStam.Value < 100 and BStam.Value > 0 then
if Character:FindFirstChild("Blocking") == nil then
BStam.Value = BStam.Value + 0.5
Stam.Frame.Visbile = true
Stam.Frame.Size = UDim2.new(BStam.Value/100,0,1,0)
elseif BStam.Value <= 0 then
DicHandler.add(enemyHumanoid, "LongStun")
enemyHumanoid.WalkSpeed = 0
enemyHumanoid.JumpPower = 0
end
end
end
end)
end
if Action == "Release" then
ButtonDown = false
return Player
end
end
Currently I tried using the Print method to figure it out, but it failed to print out anything and all I said saw ‘nil’, yet I looked through the other modules and it just didn’t make sense to me. Also, I decided to keep the other Character because I forgot, but both ways it doesn’t work and will just say Character along with Player is nil.
local RS = game:GetService("ReplicatedStorage")
local Block = RS:WaitForChild("Block")
local Combat_Handler = require(game.ServerScriptService.CombatServer.Combat_Handler)
local SSS = game:GetService("ServerScriptService")
local DicHandler = require(SSS:WaitForChild("DictonaryHandler"))
Block.OnServerEvent:Connect(function(Player, sequence)
local Character = Player.Character
local Humanoid = Character.Humanoid
local Humrp = Character.HumanoidRootPart
if not DicHandler.find(Character, "Stunned") or DicHandler.find(Character, "LongStun") then
if Combat_Handler.BlockBar() then
print("We are working")
Combat_Handler.BlockBar()
end
end
end)
ServerScriptService.CombatServer.Combat_Handler:52: attempt to index nil with ‘Name’
Is the new error. This is very odd. I might just end up making the Block Module a completely different script but I don’t know right now since the Create Hitbox module is linked directly with the damage.
local RS = game:GetService("ReplicatedStorage")
local Combat = RS:WaitForChild("Combat")
local Combat_Handler = require(script.Combat_Handler)
local SSS = game:GetService("ServerScriptService")
local DicHandler = require(SSS:WaitForChild("DictonaryHandler"))
Combat.OnServerEvent:Connect(function(Player, sequence)
local Character = Player.Character
local Humanoid = Character.Humanoid
local Humrp = Character.HumanoidRootPart
if not DicHandler.find(Character, "Stunned") or DicHandler.find(Character, "LongStun") or Combat_Handler.BlockBar() then
local Action, Length = Combat_Handler.getAnimation(Humanoid, sequence)
print("Anims Playing")
Action:Play()
Action:GetMarkerReachedSignal("Hitbox"):Connect(function()
Combat_Handler.CreateHB(Player, Character, Humrp, Length, sequence)
end)
wait(Length)
if string.len(sequence) < 4 then
Combat:FireClient(Player, false)
else
Combat:FireClient(Player, true)
end
else
Combat:FireClient(Player, false)
end
end)
UIS.InputBegan:Connect(function(Input, IsTyping)
if not IsTyping and not isblocking then
if Input.UserInputType == Enum.UserInputType.MouseButton1 then
if Debounce == false then
Debounce = true
curr = os.clock()
local PT = curr - prev
if PT < 1 then
sequence = sequence.."L"
if string.len(sequence) > 4 then
print("Resetting Combo.")
sequence = "L"
end
else
sequence = "L"
end
Combat:FireServer(sequence)
end
end
end
end)
Combat.OnClientEvent:Connect(function(bool)
prev = curr
if bool then
wait(cds[2])
Debounce = false
else
Debounce = false
end
end)
Yeah, along with that I checked around in the modules, and removed the overbearing amount of params, yet it still has the issue when I try to run the Block Module. So, right now I’m just looking for anything else that might of been overlooked.