Listening is used to wait for certain events to execute code, such as .Touched
. I am wondering if you can use the same events for the water terrain built into ROBLOX. For example, it would drown the player by lowering their health incrementally over time if they were to swim in it. How would I call my function for this type of script?
SmoothBlockModel did it in his Catching Fire game.
I would try using Touched
and TouchEnded.
Maybe start a function when they Touched
it, and end it when TouchEnded
?
EDIT: Sorry, I just realized that the 'water' material is part of Terrain
.
Try making a brick, with CanCollide false, and Transparent, but anchored, and try what I said above.
You could use one of clone troopers scripts and edit it. I makes your character "drown" if they're in water.