Hello, my fellow DEVELOPERS!!
So uhh… I’ve been trying to fix the index nil thingy for like 14 minutes, but my Silly Goose of a brain can’t figure out a solution.
I know index nil usually means the variable/object could be nil, but how does that relate to the :GetChildren() function?
Here’s the code!
local g = false
local cloud = game:GetService("ServerStorage").Cloud.Cloud:Clone()
for a,z in pairs(cloud.Parent:GetChildren()) do --< the error
if z:IsA("Part") or z:IsA("UnionOperation") then
z.Touched:Connect(function(part)
if part:FindFirstChild("Humanoid") and part.Parent ~= player.Character and g ~= true then
local victimplayer = game:GetService("Players"):GetPlayerFromCharacter(part.Parent)
victimplayer.Character.Humanoid:TakeDamage(10.9)
end
end)
end
end
(Also I’m planning to replace the .Touched function since people say its unreliable, so act that does not exist for a moment lol)