Bug with using an ability twice

  1. What do you want to achieve? Keep it simple and clear!
    I wish to achieve fixing a certain bug from my game

  2. What is the issue? Include screenshots / videos if possible!
    the issue is that one person or no one can use this ability while the other cant

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    i looked for a lot of solutions and tried a lot - working on this for like 3 days already

here are some videos on this bug

–1 player

External Media

–2 players

External Media

[Not the full code btw]
Server Code

UseReEvent.OnServerEvent:Connect(function(Player, Usage, Data)

	local Char = Player.Character
	local CharHumRootPart = Char:WaitForChild("HumanoidRootPart")

	local Weapon = Char:WaitForChild(CharInfo.Name.." Sword")

	if Usage == "Used" then
		UseReEvent:FireClient(Player, "Use")

		local MainCharValuesFolder = Char:WaitForChild("Values")
		local WalkSpeedValue = MainCharValuesFolder:WaitForChild("Walk Speed Value")

		WalkSpeedValue.Value -= 100

	end

	if Usage == "Attack Cancel" then
		local MainCharValuesFolder = Char:WaitForChild("Values")
		local WalkSpeedValue = MainCharValuesFolder:WaitForChild("Walk Speed Value")

		WalkSpeedValue.Value += 100

	end

	if Usage == "Intense 1" then
		print("Server Intete")
		local ClonedStaticSFX = StaticSFX:Clone()
		ClonedStaticSFX.Parent = Weapon:WaitForChild("Blade")
		ClonedStaticSFX:Play()

		Debris:AddItem(ClonedStaticSFX, 1.7)

	end
	if Usage == "Intense 2" then

		local ClonedStaticSFX = Weapon:WaitForChild("Blade"):WaitForChild(StaticSFX.Name)
		ClonedStaticSFX:WaitForChild("DistortionSoundEffect").Level = 0.7

	end
	if Usage == "Intense 3" then

		local ClonedStaticSFX = Weapon:WaitForChild("Blade"):WaitForChild(StaticSFX.Name)
		ClonedStaticSFX:WaitForChild("DistortionSoundEffect").Level = 0.9

	end
end)

Client Code

UseReEvent.OnClientEvent:Connect(function(Type)
	if Type == "Use" then
		LoadedThunderFlashMassAnim:Play()
		CanCancel = true
		
		IntenseFunc = LoadedThunderFlashMassAnim:GetMarkerReachedSignal("Intense"):Connect(function(Level)
			delay(3, function()
				IntenseFunc:Disconnect()
			end)
			if Level == "1" then
				
				UseReEvent:FireServer("Intense 1")

			end

			if Level == "2" then
				UseReEvent:FireServer("Intense 2")

			end

			if Level == "3" then
				UseReEvent:FireServer("Intense 3")

			end
		end)
	end
end)

Thanks! to all who helped!

2 Likes

I Fixed It Finally
by
Making sure the player is actually in the game before the script runs

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.