ive tried fixing it but any small change i make errors and the code keeps saying nothing is wrong even though it does nothing
while true do
local touching = if script.Parent.Touched then script.Parent:GetTouchingParts(script.Parent:GetTouchingParts() ~= script.Parent.Parent.base) else
if script.Parent.Parent:GetAttribute("Armed") == true then
for i, part in ipairs(touching) do
local PartN = part
print(PartN.Name)
if PartN ~= nil and script.Parent.Parent:GetAttribute("Armed") == true then script.Parent.Parent:SetAttribute("Triggered",true) end
if script.Parent.Parent:GetAttribute("Triggered") == true then print("ready")
repeat
local tick = script.Parent.Parent:GetAttribute("TriggerTime") - 1
if script.Parent.Parent:GetAttribute("TriggerTime") ~= 0 or script.Parent.Parent:GetAttribute("TriggerTime") <0 then
script.Parent.Parent:SetAttribute("TriggerTime",tick)
print(tick) end
until script.Parent.Parent:GetAttribute("TriggerTime") == 0 or script.Parent.Parent:GetAttribute("TriggerTime") <0
end
if script.Parent.Parent:GetAttribute("Explode") == true then
local explosion = Instance.new("Explosion")
explosion.BlastRadius = script.Parent.Parent:GetAttribute("BlastRad")
explosion.BlastPressure = script.Parent.Parent:GetAttribute("Strength")
explosion.DestroyJointRadiusPercent = script.Parent.Parent:GetAttribute("DestroyRad")
explosion.Position = script.Parent.Parent.base.Position
print("boom")
end
end wait(0.01)
end
end wait(0.01)
end