script.Parent.Touched:Connect(function(hit) if hit ~= game.Workspace.Spawner then -- the ~= means "Does not equal" local EX = Instance.new("Explosion") EX.DestroyJointRadiusPercent = 0 EX.Position = script.Parent.Position EX.BlastPressure = 10 EX.BlastRadius = 40 EX.Hit:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") ~= nil then hit.Parent:FindFirstChild("Humanoid"):TakeDamage(2) EX.Parent = script.Parent end end)
i def did something wrong but it doesnt show errors
You have the script set the explosion to workspace when the explosion is hit. Explosions only explode when they are a descendant of workspace. You’d have to set it’s parent before the event.
EX.Position = script.Parent.Position EX.BlastPressure = 10 EX.BlastRadius = 40 EX.Parent = script.Parent EX.Hit:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") ~= nil then hit.Parent:FindFirstChild("Humanoid"):TakeDamage(2) end end)