Why do some stuff stop working in my game?

I see that some Connect() functions aren’t working in my game. There are no errors. I changed nothing in my scripts that lead to non-functioning Connect()'s.

Is my game too big? I find it relatively small compared to the frontpage games on Roblox.

Would you mind if you displayed some scripts that do not function like intended? :Connect() functions should work all the time.

1 Like
local BattleEngage = require(game.ReplicatedStorage.BattleModules.BattleEngage)
local RegularEngagePart = script.Parent.Parent.Engages.RegularEngage
local EnemiesLvl = script.Parent.Parent.Engages.EnemiesLvl

BattleEngage.Engaged(RegularEngagePart, EnemiesLvl)
-- ...
function BattleEngage.Engaged(RegularEngagePart, EnemiesLvl)
	RegularEngagePart.Touched:Connect(function(hit)
		if game.Players:GetPlayerFromCharacter(hit.Parent) then
			local pos = RegularEngagePart.Position
			RegularEngagePart.Parent.Parent:Destroy()
-- ...

It has like 30/70 chance that it will run.

The problem is not on the :connect() rather that .Touched has a decent chance not to fire. Also debounce is a problem I found with touched
Here’s a raycasting hit box module you can look into Raycast Hitbox 4.01: For all your melee needs!

1 Like

There’s no debounce in my Touch() scripts. And it also seem that my While true dodoesn’t run too (No errors), like never runs. I’m using Touched to play events like teleporting, etc and not for damaging objects (meleeing).

EDIT: My global local functions aren’t working either.

Yeah idk… I guess no one knows huh?

1 Like

Your script probably isn’t running at all. Where is it located in the explorer and what type of script is it?

2 Likes

I’m just stupid. It’s working cuz I forgot to type some stuff in the script, but the Touch:Connect() sometimes working and not working is annoying af.

Just from experience, I’ve tried to make a terminal with touched, however found that if you had shiftlock, it wouldn’t fire some of the times. I would suggest other methods, in regards to the debounce I was talking about, I am pretty sure there is a delay between allowing a touch event to fire (might be wrong).