I'm about to make a game that contains a radioactive rain but there're two little something.
How to make the rain (I simulate the rain using the fog in lighting tab) appears randomly.
How can I make it drain people's health IF they're out in the open (Not under a shelter)
Sorry for my grammars if there're any error.
1) To make the rain you could use GUIs. (An example of this can be seen here.)
2) To find out if they are not under shelter, you could cast a ray above them and check if any parts are returned, if not they are in the open. A simple loop should suffice for the health drain.
1: Use math.random() to randomise the X and Z axis of the rain. Example:
Rain.CFrame = CFrame.new(math.random(100, -100), 0, math.random(100, -100))
2: Make it so that the rain gets removed when it touches an object using the Touched event, so that it won't hit the players once they are underneath the shelter. Then, if it does touch them, just make their health lower. Example:
Rain.Touched:connect(function(Hit) local Humanoid = Hit.Parent:findFirstChild("Humanoid") if Humanoid then Humanoid.Health = Humanoid.Health - 5 end Rain:Destroy() end)