Why doesnt this work

idk ive been looking at this for a while and im so confused on why it DOESNT work, the localscript changes everything cause i can attack right after summon, but the server just doesn’t print anything

my brain hurts too much

localscript:

UserInputService.InputBegan:Connect(function(Input, Processed)
	if not Processed then
		--> Summon
		if Input.KeyCode == Enum.KeyCode.Q then
			if not SummonCooldown and not Cooldown then --> If we aren't on summon cooldown, And we aren't attacking.
				if not Summoned then --> If we haven't already summoned the stand, then do so.
					Summoned = true
					Summon:FireServer(Summoned)
				else --> Or if we have, Get rid of it.
					Summoned = false
					Summon:FireServer(Summoned)
				end
			end
			SummonCooldown = true --> Make sure we have a cooldown for summoning.
			coroutine.wrap(function()
				task.wait(3)
				SummonCooldown = false --> Now we can summon again.
			end)()

			--> Barrage
		elseif Input.KeyCode == Enum.KeyCode.E then
			if Summoned then --> If our stand is summoned
				if not BarrageCooldown and not Cooldown then --> If our barrage isnt on cd, Nor are we busy attacking.
					if not BarrageHeld then --> If we aren't already barraging
						BarrageHeld = true
						Cooldown = true

						Barrage:FireServer(BarrageHeld)
						coroutine.wrap(function()
							task.wait(5)
							if BarrageHeld then --> If after X seconds, We're still barraging we stop.
								BarrageHeld = false
								Barrage:FireServer(BarrageHeld)
							end
						end)()
					end
				end
				
				
				
			end
		end
	end
end)

script:

Summon.OnServerEvent:Connect(function(Player, State)
	local Character = Player.Character
	if State then
		print("true")	
	else
		print("false")	
	end
end)

are there any errors on the console?

Nope, Nothing and everything besides the script works

Try adding a print statement after this line to know if the server is receiving the info.

It is not receiving the info… That’s weird…

BTW
Script is in character, LocalScript is in Backpack

Try putting the script into server script servcie.

I can’t it’s in the character cause everyone will have a diffrent script that handles their class

It worked perfectly fine till i started working somewhere with the cooldowns

can I see where u assign the variables?

--//Services
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")

--//Instances
local Player = game.Players.LocalPlayer
repeat wait() until Player.Character
local Character = Player.Character

--//Events
local Events = Character.StandHandler:WaitForChild("Events")

--> Common Abilities
local Summon = Events:FindFirstChild("Summon")
local Barrage = Events:FindFirstChild("Barrage")
local HeavyPunch = Events:FindFirstChild("Heavy Punch")
local Summon = Events:FindFirstChild("Star Finger")

--> Special Abilities
local Timestop = Events:FindFirstChild("Timestop")
local Beatdown = Events:FindFirstChild("Beatdown")

--//Data
local Summoned = false
local Cooldown = false

--> Moveset Cooldown
local SummonCooldown = false

local BarrageCooldown = false
local HeavyCooldown = false
local FingerCooldown = false

local TimestopCooldown = false
local BeatdownCooldown = false

--> Moveset Data
local BarrageHeld = false

--//Functions

--//Setup

--//Script

Below script is the InputBegan.

image
Here, you are setting the cooldown to true and you are not setting it to false again.

My bad! Apparently i didn’t show you the inputended part of my localscript.

--> Mainly for detecting barrage let-go.
UserInputService.InputEnded:Connect(function(Input)
	--> Barrage
	if Input.KeyCode == Enum.KeyCode.E then
		if BarrageHeld then --> If we are barraging
			BarrageHeld = false --> Stop barraging
			Cooldown = false --> Now we can use another attack again.

			Barrage:FireServer(BarrageHeld)
			BarrageCooldown = true --> Put our barrage on a cooldown
			coroutine.wrap(function()
				task.wait(10)
				BarrageCooldown = false --> We can now use our barrage again.
			end)()
		end
	end

	--> Other moveset
end)
1 Like

do u mind sending me a place file with just these scripts and remotes?

Sure, This should have the bug

Ok so I tested it out and I am pretty sure it is due to you creating remote events for every player. I tried manually firing the remote event and it worked.

Huh? But then why’d it work before?

Not sure, but I recommend using a single remote event to handle the summoning of the stands.

Thanks, I’ll try it and if it works i’ll checkmark you.

image
Well… I know what the issue is now! :sweat:

3 Likes

Oh wow I didn’t even see that lol