#I have an error and dont know how to fix that

1 messages · Page 1 of 1 (latest)

rigid trout
#

Pleas help

blissful sinew
#

?

rigid trout
#

Ich have 3 script. 1:client combat

blissful sinew
#

please send the code

rigid trout
#

Alr

blissful sinew
#

client combat?

#

also ik im new but i script alot

rigid trout
#

I have 3 script should I Send all

blissful sinew
#

sure

#

but you can send the parts which you think is the culprit

blissful sinew
rigid trout
#

The Error Said request module experienced an Error while loading

vital sleet
#

mght be ur wifi]

blissful sinew
#

fr

rigid trout
#

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UserinputService = game:GetService("UserInputService")
local CombatRemote = ReplicatedStorage.Remotes.CombatRemotes
local ClientAnimator = ReplicatedStorage.Remotes.ClientAnimator
local Replicator = ReplicatedStorage.Remotes.Replicator
local attackCooldown = false

local Animation = ReplicatedStorage.Animations

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()

local tracks = {}
for i = 1,4 do
local a = Animation:FindFirstChild("M"..i)
tracks[i] = character:WaitForChild("Humanoid"):LoadAnimation(a)
end

UserinputService.InputBegan:Connect(function(input,gp)
if gp then return end
if input.UserInputType == Enum.UserInputType.MouseButton1 and attackCooldown == false then
attackCooldown = true
task.delay(.5,function()
attackCooldown = false
end)
CombatRemote:FireServer()
end
end)

ClientAnimator.OnClientEvent:Connect(function(combo)
local t = tracks[combo]
if t then t:play() end
end)

Replicator.OnClientEvent:Connect(function(hrp:Part)
local VFX = game.ReplicatedStorage.VFX.HitVFX.Attachment:Clone()
VFX.Parent = hrp
game.Debris:AddItem(VFX,2)
for i,v in VFX:GetChildren() do
if v:IsA("ParticleEmitter") then
v:Emit(v:GetAttribute("EmitCount"))
end
end

end)

vital sleet
#

happens on my pc

#

so i use my laptop#

rigid trout
#

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")

local attackEvent = game.ReplicatedStorage.Remotes.CombatRemotes
local ClientEvent = game.ReplicatedStorage.Remotes.ClientAnimator
local CombatModule = require(game.ServerScriptService.Modules.CombatModule)
local combats = {}

Players.PlayerAdded:Connect(function(player: Player)
combats[player] = CombatModule.new(player)
end)

Players.PlayerRemoving:Connect(function(player)
combats[player] = nil
end)

attackEvent.OnServerEvent:Connect(function(player)
local combatPlayer = combats[player]
if combatPlayer then
combatPlayer:Attack()
ClientEvent:FireClient(player,combatPlayer.combo)
end
end)

#

i have 1 more script but its too long to send

blissful sinew
#

yea

#

most likely wifi

rigid trout
#

i have good wifi

blissful sinew
#

do you have a var from the module

#

like return var?

coral raptorBOT
#

studio** You are now Level 1! **studio

rigid trout
#

i have one more script but its too long to send

blissful sinew
#

the module im guessing?

rigid trout
#

yes combat modules

#

could you call and ill stream but no talk

blissful sinew
#

no sorry

rigid trout
#

how sould i send the scipt then

coral raptorBOT
#

studio** You are now Level 2! **studio

vital sleet
#

ae

#

send as file

blissful sinew
#

but check to see if your module does return a value

rigid trout
blissful sinew
#

upload as txt

vital sleet
vital sleet
#

trust no clickbait

blissful sinew
#

see the plus?

vital sleet
#

yes the plus

blissful sinew
#

click on that

vital sleet
#

then it says upload as message file

blissful sinew
#

yes

vital sleet
#

u need ot haeve smth typed

rigid trout
#

local Combat = {}
Combat.__index = Combat

local ZoneModule = require(game.ServerScriptService.Modules.Zone)

function Combat.new(player:Player)
local self = setmetatable({}, Combat)
self.player = player
self.character = player.Character or player.CharacterAdded:Wait()
self.hrp = self.character:WaitForChild("HumanoidRootPart")
self.combo = 0
self.busy = false
self.lastAttacktime = 0
self.HitCD = {}
self.HitboxDelay = .35
self.idleTimeout = 1.5
return self
end

function Combat:Attack()
if self.busy == true then return end
self.busy = true
local now = tick()
if now - 0 > self.idleTimeout then
self.combo = 0
end
self.combo = self.combo + 1
if self.combo > 4 then
self.combo = 1
end
print("punched")

task.delay(self.HitboxDelay,function()
    local hitbox = Instance.new("Part")
    hitbox.Anchored = true
    hitbox.CanCollide = false
    hitbox.Transparency = .6
    hitbox.CastShadow = false
    hitbox.BrickColor = BrickColor.new("Really red")
    hitbox.Massless = true
    hitbox.Size = Vector3.new(7,7,7)
    hitbox.Parent = workspace
    hitbox.CFrame = self.hrp.CFrame * CFrame.new(0,0,-6)
    game.Debris:AddItem(hitbox,.5)
#

local newZone = ZoneModule.new(hitbox)
newZone.partEntered:Connect(function(v)
if v.Parent:FindfirstChild("Humanoid") and v.Parent.Name ~= self.character.Name then
if not self.HitCD[v.Parent] then
self.HitCD[v.Parent] = true
task.delay(.5,function()
self.HitCD[v.Parent] = nil
end)
local enemyhumanoid = v.Parent:FindFirstChild("Humanoid")
enemyhumanoid:TakeDamage(5)

                game.ReplicatedStorage.Remotes.Replicator:FireAllClients( v.Parent:FindFirstChild("HumanoidRootPart))
                
            end
        end
    end)
end)


self.lasAttackTime = now
local cooldown = (self.combo == 4) and 1.5 or .5
task.delay(cooldown,function()
    self.busy = false
end)

if self.combo == 4 then
    task.delay(cooldown,function()
        self.combo = 0
    end)
end

end

return Combat

blissful sinew
vital sleet
#

here u go

blissful sinew
#

uh

#

its kind of the same

rigid trout
blissful sinew
#

but better

vital sleet
coral raptorBOT
#

studio** You are now Level 2! **studio

blissful sinew
#

uh why did you not add end)?
task.delay(self.HitboxDelay,function()
local hitbox = Instance.new("Part")
hitbox.Anchored = true
hitbox.CanCollide = false
hitbox.Transparency = .6
hitbox.CastShadow = false
hitbox.BrickColor = BrickColor.new("Really red")
hitbox.Massless = true
hitbox.Size = Vector3.new(7,7,7)
hitbox.Parent = workspace
hitbox.CFrame = self.hrp.CFrame * CFrame.new(0,0,-6)
game.Debris:AddItem(hitbox,.5)

vital sleet
#

i just uploaded as txt file

blissful sinew
#

nvm

rigid trout
#

oh no its just in 2 messeges it moved to the right

blissful sinew
#

i see

#

local newZone = ZoneModule.new(hitbox)
newZone.partEntered:Connect(function(v)
if v.Parent:FindfirstChild("Humanoid") and v.Parent.Name ~= self.character.Name then
if not self.HitCD[v.Parent] then
self.HitCD[v.Parent] = true
task.delay(.5,function()
self.HitCD[v.Parent] = nil
end)
local enemyhumanoid = v.Parent:FindFirstChild("Humanoid")
enemyhumanoid:TakeDamage(5)

                game.ReplicatedStorage.Remotes.Replicator:FireAllClients( v.Parent:FindFirstChild("HumanoidRootPart))

            end
        end
    end)
end)
#

this doesn't have enough ends

#

which causes an eof error

rigid trout
#

where should i end it then

blissful sinew
#

or end of file

#

im gonna edit

#

full scripttask.delay(self.HitboxDelay,function()
local hitbox = Instance.new("Part")
hitbox.Anchored = true
hitbox.CanCollide = false
hitbox.Transparency = .6
hitbox.CastShadow = false
hitbox.BrickColor = BrickColor.new("Really red")
hitbox.Massless = true
hitbox.Size = Vector3.new(7,7,7)
hitbox.Parent = workspace
hitbox.CFrame = self.hrp.CFrame * CFrame.new(0,0,-6)
game.Debris:AddItem(hitbox,.5)
local newZone = ZoneModule.new(hitbox)
newZone.partEntered:Connect(function(v)
if v.Parent:FindfirstChild("Humanoid") and v.Parent.Name ~= self.character.Name then
if not self.HitCD[v.Parent] then
self.HitCD[v.Parent] = true
task.delay(.5,function()
self.HitCD[v.Parent] = nil
end)
local enemyhumanoid = v.Parent:FindFirstChild("Humanoid")
enemyhumanoid:TakeDamage(5)

            game.ReplicatedStorage.Remotes.Replicator:FireAllClients(v.Parent:FindFirstChild("HumanoidRootPart"))

        end
    end
end)

end)

#

task.delay(self.HitboxDelay,function()
local hitbox = Instance.new("Part")
hitbox.Anchored = true
hitbox.CanCollide = false
hitbox.Transparency = .6
hitbox.CastShadow = false
hitbox.BrickColor = BrickColor.new("Really red")
hitbox.Massless = true
hitbox.Size = Vector3.new(7,7,7)
hitbox.Parent = workspace
hitbox.CFrame = self.hrp.CFrame * CFrame.new(0,0,-6)
game.Debris:AddItem(hitbox,.5)
local newZone = ZoneModule.new(hitbox)
newZone.partEntered:Connect(function(v)
if v.Parent:FindfirstChild("Humanoid") and v.Parent.Name ~= self.character.Name then
if not self.HitCD[v.Parent] then
self.HitCD[v.Parent] = true
task.delay(.5,function()
self.HitCD[v.Parent] = nil
end)
local enemyhumanoid = v.Parent:FindFirstChild("Humanoid")
enemyhumanoid:TakeDamage(5)

            game.ReplicatedStorage.Remotes.Replicator:FireAllClients(v.Parent:FindFirstChild("HumanoidRootPart"))

        end
    end
end)

end)

#

i fixed it