local Players = game:GetService("Players")
local plr
Players.PlayerAdded:Connect(function(player)
plr = player
repeat
wait(0.1)
until workspace:FindFirstChild(player.Name.."Bomb").Fire.Value == true and script.Parent.Parent ~= "ObjectFolder" -- error line
end)
local PartC = 0
local explosion = Instance.new("Explosion")
local PartCs = script.Parent.Parent.Parent.PartM
local PartCss = script.Parent.Parent.Parent.PartD
explosion.Hit:Connect(function(part, distance)
if part.Name ~= "ExplosionPart" then
part.Anchored = false
if distance >= 25 then
PartC += 1
PartCss.Value += 1
print(PartCs)
print(part.Name.." was hit "..distance.." studs away from the explosion.")
else
PartC += 1
PartCs.Value += 1
print(PartC)
print(part.Name.." was hit "..distance.." studs away from the explosion.")
end
end
end)
explosion.Parent = workspace:FindFirstChild(plr.Name.."Bomb")
explosion.BlastRadius = 5
explosion.BlastPressure = 50000
explosion.Position = script.Parent.Position
local children = script.Parent.Parent:GetChildren()
for i = 1, #children do
local child = children[i]
child.CanCollide = false
child.Transparency = 100
end
local players = game:GetService("Players")
local plr = nil
players.PlayerAdded:Connect(function(player)
plr = player
print(tostring(plr))
end)
Try this:
local players = game:GetService("Players")
local plr = nil
Players.PlayerAdded:Connect(function(player)
plr = player
repeat
wait(0.1)
until workspace:FindFirstChild(tostring(plr).."Bomb").Fire.Value == true and script.Parent.Parent ~= "ObjectFolder" -- error line
end)