-
basically it’s suppose work how it does already right now it’s just a rain script simple as that Rain and Splashes effects, nothing is technically wrong just won’t work as intended.
-
some reason the script works completely fine except when there is another player who joins the game some reason “Drops” from the RainParticles model is not being destroyed when one of the local players are under cover, it works for everything except for the Drops and it only happens if theres another player in the game
-
i tried everything i can think of to changing how it removes it and how it places the model to the Workspace, since workspace is server then i tried changing it to try making it for the client instead but idk it wouldn’t let me i can’t do it lol even tried to change the under cover functionality still won’t work.
-note- yea this was a free model but i was trying to edit it and fix it up make it work better in general and i got it good rn but its just 1 issue with it i can’t figure out
local particles = script:WaitForChild("RainParticles")
local underCover = false
local camera = workspace.CurrentCamera
local tweenService = game:GetService("TweenService")
local balls = {}
local lastBall = tick()
local function RenderStepHandler()
local player = game.Players.LocalPlayer
if not underCover then
if workspace:FindFirstChild("RainParticles") and workspace.RainParticles ~= particles then
workspace.RainParticles:Destroy()
end
particles.Parent = workspace
if tick() - lastBall >= Random.new():NextNumber(0.3, 0.7) then
local ball = Instance.new("Part")
local specialMesh = Instance.new("SpecialMesh", ball)
specialMesh.MeshType = Enum.MeshType.Sphere
ball.Material = Enum.Material.Glass
ball.Transparency = 0.5
ball.CastShadow = false
ball.Anchored = true
ball.CanCollide = false
local size = Random.new():NextNumber(0.1, 1.3)
ball.Size = Vector3.new(size, size, size)
local x = Random.new():NextNumber(-40/2, 40/2)
local y = Random.new():NextNumber(-15/2, 15/2)
local xOffset = camera.CFrame.RightVector * x
local yOffset = camera.CFrame.UpVector * y
local zOffset = camera.CFrame.LookVector * 10
local yTweenValue = Instance.new("NumberValue")
yTweenValue.Value = 0
table.insert(balls, {ball, x, y, yTweenValue})
ball.Parent = workspace
spawn(function()
wait(wait(Random.new():NextNumber(0, 1)))
local tweenInfo = TweenInfo.new(Random.new():NextNumber(1, 3), Enum.EasingStyle.Quint, Enum.EasingDirection.In)
local transparencyTween = tweenService:Create(ball, tweenInfo, {Transparency = 1})
transparencyTween:Play()
local dropTween = tweenService:Create(yTweenValue, tweenInfo, {Value = Random.new():NextNumber(1, 5)})
dropTween:Play()
transparencyTween.Completed:Wait()
ball:Destroy()
end)
lastBall = tick()
end
else
particles.Parent = game.ReplicatedStorage
end
local rayParams = RaycastParams.new()
rayParams.FilterDescendantsInstances = {script.Parent, particles}
local head = player.Character:WaitForChild("Head")
if head then
local ray = workspace:Raycast(head.Position, head.Position + Vector3.new(0, 100000000, 0), rayParams)
if ray and ray.Instance and ray.Instance.Transparency < 1 then
underCover = true
else
underCover = false
end
end
for i, ballInfo in pairs(balls) do
local xOffset = camera.CFrame.RightVector * ballInfo[2]
local yOffset = camera.CFrame.UpVector * ballInfo[3]
local zOffset = camera.CFrame.LookVector * 10
local dropOffset = -camera.CFrame.UpVector * ballInfo[4].Value
ballInfo[1].CFrame = camera.CFrame + xOffset + zOffset + yOffset + dropOffset
local size = ballInfo[1].Size
ballInfo[1].Size = Vector3.new(size.X, size.Y + ballInfo[4].Value/Random.new():NextNumber(70, 90), size.Z)
end
end
RenderStepConnection = game:GetService("RunService").RenderStepped:Connect(RenderStepHandler)
RenderStepConnection:Disconnect()
task.wait(0.01)
RenderStepConnection = game:GetService("RunService").RenderStepped:Connect(RenderStepHandler)