Answered by
3 years ago Edited 3 years ago
Hello Bankrovers,
My name is YelloMynamesZak and I'd be happy to help you with your problem.
You could try this: Make a part that represents the region. After you're done, name it "Region".
Then, put a localscript in StarterCharacterScripts and type the following:
02 | local part = workspace.Region |
03 | part.Touched:Connect( function () |
05 | print ( "Player is in region" ) |
07 | part.TouchEnded:Connect( function () |
09 | print ( "Player is NOT in region" ) |
This’ll work for a local script. If this is a server sided script then you can make a table which has each user’s ID as the index, and the value equal to false. Set it equal to true upon touching the part, then set it to false upon the touch ending. It's much more simpler than the code you provided and can be connected to server scripts via remote events.
Please reply to this answer is you're facing any issues.
Hope this helps!