It’s either lagging too much, or more likely it looks like ‘ground’ is incorrectly assigned. I really recommend just setting CanCollide=false and ditching the Touched event at the bottom. Blocks disappear when they fall out of the world after all.
1 Like
Maybe try this code?
local Droplets = 0
local ground = game.Workspace.Ground
while true do
local Rain = Instance.new ("Part")
if Droplets >= 2000 then
break
end
local RNGX = math.random(1,99)
local RNGZ = math.random(1,163)
Droplets = Droplets + 1
Rain.Parent = game.Workspace
Rain.Name = "RainDrop"
Rain.Size = Vector3.new(.5,1.5,.5)
Rain.Transparency = .5
Rain.CanCollide = true
Rain.BrickColor = BrickColor.new("Electric blue")
Rain.Anchored = false
Rain.Position = Vector3.new(RNGX,13,RNGZ)
Rain.Material = "SmoothPlastic"
wait(1.5)
ground.Touched:Connect(function(hit)
if hit.Name == "Rain" then
wait(2)
hit:Destroy()
end
end)
end
1 Like
I got it working the way I wanted it to, thanks guys!
local Droplets = 0
local ground = game.Workspace.Ground
local Rain = Instance.new("Part")
while true do
local RNGX = math.random(1,99)
local RNGZ = math.random(1,163)
local Rain = Instance.new("Part")
Droplets = Droplets + 1
Rain.Parent = game.Workspace
Rain.Name = "RainDrop"
Rain.Size = Vector3.new(.5,1.5,.5)
Rain.Transparency = .5
Rain.CanCollide = true
Rain.BrickColor = BrickColor.new("Electric blue")
Rain.Anchored = false
Rain.Position = Vector3.new(RNGX,-1,RNGZ)
Rain.Material = "SmoothPlastic"
wait()
ground.Touched:Connect(function(hit)
if Rain then
wait(.5)
Rain:Destroy()
end
end)
end
A thing to note is that “eof” means end of file. I just saw your error recently and it said “Expected ‘end’(to close ‘do’ at line 4), got eof; did you forget to close then at line 20?”
This most likely because you’re missing an end. But if it’s the other way around, and it says that it’s expecting then more than likely you have too much ends, or at least, more than enough.
1 Like