Player can touch part only once?

Checked on both, same effect.

aaINeed30CharactersToPostThisaaa

2 Likes
part.Touched:Connect(function(hit)
     print("Hello")
	
end)

So this does nothing?(On the second time)

2 Likes

It printed, but it didn’t play the ending
First I tried the print on both scripts and they printed.
Then I tried the print on the scripts, but with the print in the begging of the touch event and the rest after it.

It printed, but didn’t do the rest.

2 Likes

Sorry I took so long. My devfourm kept giving me 502 errors. Try putting print statements in different parts of the function such as the hit is a player.

2 Likes

I did what you told, the only prints that printed were the ones I put at the very begging of the touch event.

1 Like

So if hit.Parent:FindFirstChild(“Humanoid”) did not run?

1 Like

only ran the first time.

INeed30CharactersToPostThis

Is something happening to the player character?

nope, checked it from server side and client side.

Try removing that if statement, do the others run

which one of the three?
The one at the begging will just break the script cuz it defines the player on the server side

INeed30CharactersToPostThis

The one that checks for humanoid

It still doesn’t work on the second try.
It works just fine on the first one.

Try getting rid of the other if statements and test again

This isn’t an answer, but I suggest you use a remote event or a remote function to tell the client to move the player to the menu screen instead of checking if the player touches the exit from both the server and the client. This way, you’ll only need to check once on the server, without checking again on the client.

1 Like

Also, check if that battery gui still exists the second time.

1 Like

I actually bumped into something by trying this, the ending played, the player got teleported to the spawn room and got sent to the main menu afterwards by ignoring the 3rd if statement, but everything worked, except at the start a screen is meant to appear which I’m sure I’ll be able to fix.

This should say light.visible == true

That line is part of the 3rd If statement, and by ignoring it the part can be touched and the ending plays even on the second time.

I made the line the way you showed and it turned the script back to the way it was at the very start.
But thanks for pointing that out anyways.

I think that the issue was possibly with the battery hud, because now that you are properly running the check, its having trouble.(Also is the problem fixed).