RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"constantly keep getting touching parts when bool == true"
-- server script local part = script.Parent.TriggerMG local s = script.Parent.TriggerMG.Shoot local shots = script.Parent.Browning.Gunshots local bool = script.Parent.Shoot local seat = script.Parent.Parent.Body.Seatt local function onPartTouched(otherPart) local model = otherPart.Parent local humanoid = model:FindFirstChild("Zombie") if bool.Value == true then local transparencySequence = NumberSequence.new(0) shots.FX.Transparency = transparencySequence shots.FlashFX.Enabled = true s:Play() if humanoid then humanoid.Health -= 350 task.wait(1) end elseif bool.Value == false then task.wait(0.6) local transparencySequence1 = NumberSequence.new(1) shots.FX.Transparency = transparencySequence1 shots.FlashFX.Enabled = false s:Stop() end end while true do if bool.Value == true then local partsTouching = part:GetTouchingParts() for i, otherPart in ipairs(partsTouching) do onPartTouched(otherPart) end task.wait(1) else task.wait(0.6) local transparencySequence1 = NumberSequence.new(1) shots.FX.Transparency = transparencySequence1 shots.FlashFX.Enabled = false s:Stop() end end